I'm trying to send mail to new register users on my Laravel 5.8 application but every time I am getting the error from SwiftMailer
""" Failed to authenticate an SMTP server with username "bisht.gaurav808@gmail.com" using 3 possible authenticators.
1)Authenticator CRAM-MD5 returned Expected response code 235 but got code "535", with a message "535 5.7.0 Invalid login or password". 2)Authenticator LOGIN returned Expected response code 250 but got an empty response. 3) Authenticator PLAIN returned Expected response code 250 but got an empty response """
I have looked up for solution in "StackOverflow" and do some changes in my mail.php, .env and in my google account.
What I have don't so Far
1) Enable Two-step verification in Google account 2) Generate App password in Gmail. 3) Update my configuration in .env file
mail.php
return [
'driver' => env('MAIL_DRIVER', 'smtp'),
'host' => env('MAIL_HOST', 'smtp.gmail.com'),
'port' => env('MAIL_PORT', 587),
'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'bisht.gaurav808@gmail.com'),
'name' => env('MAIL_FROM_NAME', 'PASS'),
],
'encryption' => env('MAIL_ENCRYPTION', 'ssl'),
'username' => env('MAIL_USERNAME','bisht.gaurav808@gmail.com'),
'password' => env('MAIL_PASSWORD','ucluxxxxxxxxaejq'),
'sendmail' => '/usr/sbin/sendmail -bs',
'markdown' => [
'theme' => 'default',
'paths' => [
resource_path('views/vendor/mail'),
],
],
'log_channel' => env('MAIL_LOG_CHANNEL'),
];
.env file
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=465
MAIL_USERNAME=bisht.gaurav808@gmail.com
MAIL_PASSWORD="ucluxxxxxxxxaejq" // i have replace my gmail password with app
password provided by Gmail
MAIL_AUTH_MODE: login
MAIL_ENCRYPTION=ssl