7
I’m having trouble emailing with Laravel 5.2. You’re returning this mistake to me:
Expected response code 250 but got code "530",
with message "530-5.5.1 Authentication Required.
The archive .env
is like this:
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=******
MAIL_ENCRYPTION=tls
The company’s email domain is hosted on Google. I can log into gmail normal with the email and password I put on .env
.
The archive config/mail.php
is like this:
return [
'driver' => env('MAIL_DRIVER', 'smtp'),
'host' => env('MAIL_HOST', 'smtp.gmail.com'),
'port' => env('MAIL_PORT', 587),
'from' => ['address' => '[email protected]', 'name' => 'teste'],
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('[email protected]'),
'password' => env('****'),
'sendmail' => '/usr/sbin/sendmail -bs',
];
I’m e-mailing like this:
Mail::send('emails.recuperar-senha', $dados, function ($message) {
$message->to(Input::get('email'));
});
You’re testing it locally or on the web ?
– Diego Souza
I’m trying to locally.
– Amanda Lima
I read "madly". Rsrsrs I have this problem here on my Localhost. I can’t send anything by email. I always try it on the server and it works. To make a test, change the driver of smtp for mail.
– Diego Souza
I already found the problem. It’s with email. You need to give a permission to send SMTP by being in a domain other than google.com
– Amanda Lima