Galera estou usando o código abaixo e esta me retornando um erro que também esta abaixo, acho que não esta encontrando a class mas não sei como arrumar poderiam me ajudar?
Fatal error: Uncaught Error: Class 'Estoque\Controller\MimeType' not found in /Applications/XAMPP/xamppfiles/htdocs/estoque/skeleton-application/module/Estoque/src/Estoque/Controller/IndexController.php:132 Stack trace: #0 /Applications/XAMPP/xamppfiles/htdocs/estoque/skeleton-application/vendor/zendframework/zend-mvc/src/Controller/AbstractActionController.php(82): Estoque\Controller\IndexController->contatoAction() #1 [internal function]: Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent)) #2 /Applications/XAMPP/xamppfiles/htdocs/estoque/skeleton-application/vendor/zendframework/zend-eventmanager/src/EventManager.php(444): call_user_func(Array, Object(Zend\Mvc\MvcEvent)) #3 /Applications/XAMPP/xamppfiles/htdocs/estoque/skeleton-application/vendor/zendframework/zend-eventmanager/src/EventManager.php(205): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure)) #4 /Applications/XAMPP/xamppfiles/htdocs/estoque/skeleton-application/vendor/zendf in /Applications/XAMPP/xamppfiles/htdocs/estoque/skeleton-application/module/Estoque/src/Estoque/Controller/IndexController.php on line 132
use Zend\Mail\Message;
use Zend\Mail\Transport\Smtp as SmtpTransport;
use Zend\Mime\Message as MimeMessage;
use Zend\Mime\Part as MimePart;
use Zend\Mail\Transport\SmtpOptions;
public function contatoAction()
{
if($this->request->isPost()) {
$nome = $this->request->getPost('nome');
$email = $this->request->getPost('email');
$mensagem = $this->request->getPost('msg');
$html = new MimeType("
<b>Nome:</b> {$nome},<br>
<b>Email:</b> {$nome},<br>
<b>Mensagem:</b> {$nome},
");
$html->type = 'text/html';
$body = new MimeMessage();
$body->addPart($html);
$email = new Message();
$email->addTo("paulozanc@gdteam.com.br");
$email->setSubject("Contato feito pelo formulario estoque!");
$email->addFrom("paulozanc@gdteam.com.br");
$email->setBody($body);
$config = array(
'host' => 'smtp.gmail.com',
'connection_class' => 'login',
'connection_config' => array(
'ssl' => 'tls',
'username' => 'paulozanc@gdteam.com.br',
'password' => 'T949585757t'
),
'port' => 587,
);
$transport = new SmtpTransport();
$options = new SmtpOption($config);
$transport->setOption($options);
$transport->send($email);
$this->flashMessenger()->addSuccessMessage("Email enviado com sucesso!");
}
return new ViewModel();
//exit();
}