-1
Hello,
I’m trying to send an email using Laravel 5.7, and I had some problems.
I wrote a view for my email. Then I send the email rendered by the Controller, as follows:
Mail::send('admin.eventos.pessoa', ['pessoa' => $pessoa], function ($message) use ($pessoa){
$message->to($pessoa->email);
});
I configured my email in Laravel as follows, the way I always do in test applications:
MAIL_DRIVER=smtp
MAIL_HOST=mx1.hostinger.com.br
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=senha
MAIL_ENCRYPTION=tls
In addition, I configured the mail.php file to resolve the previous error "stream_socket_enable_crypto(): SSL Operation failed with code 1. Openssl Error messages: * error:1416F086:SSL routines:tls_process_server_certificate:Certificate Verify failed", as described the English version of the OS.
'stream' => [
'ssl' => [
'allow_self_signed' => true,
'verify_peer' => false,
'verify_peer_name' => false,
],
],
Well, then I call the controller method that calls this first snippet that I put to the question. This controller is called via Post. But instead of the email being sent, I get this as a response:
Swift_transportexception thrown with message "Expected Response code 354 but got code "554", with message "554 5.5.1 Error: no Valid Recipients ""
What can it be?
What I’ve already tried:
- Install the guzzle library;
- Switch TLS encryption to SSL;
- Check the server connection.
They all didn’t work out.
I appreciate the answers.