I think help may start with the link in the error message?
Apr 12, 2016
17
Level 70
Sending email problem with gmail
I am trying to send email from localhost with gmail. I already Allow less secure apps: ON and I edited my mail.php file like as follows-
return [
'driver' => env('MAIL_DRIVER', 'smtp'),
'host' => env('MAIL_HOST', 'smtp.gmail.com'),
'port' => env('MAIL_PORT', 587),
'from' => ['address' => 'callforconference@gmail.com', 'name' => 'call for conference'],
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('callforconference'),
'password' => env('*****************'),
'sendmail' => '/usr/sbin/sendmail -bs',
];
And .env, I edited like that-
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=callforconference
MAIL_PASSWORD=**************
MAIL_ENCRYPTION=tls
Now within controller, I wrote the following code-
$user = User::find(1)->toArray();
Mail::send('emails.joinMail', $user, function($message) use ($user){
$message->to($user['email']);
$message->subject('Welcome to cFc Network');
});
However, at the end of the day, I got following error-
Swift_TransportException in AbstractSmtpTransport.php line 383:
Expected response code 250 but got code "530", with message "530-5.5.1 Authentication Required. Learn more at
530 5.5.1 https://support.google.com/mail/answer/14257 22sm44931266pfh.48 - gsmtp
"
Any opinion to solve that?
Please or to participate in this conversation.