I am using laravel 5.2, And the using Swift Mailer for password resetting.
I have 2-step verification on my gmail..
As the google help says :
If you've turned on 2-Step Verification for your account, you might need to enter an App password instead of your regular password.
I have the following settings on mail.php
:
return [
'driver' => env('MAIL_DRIVER', 'smtp'),
'host' => env('MAIL_HOST', 'smtp.gmail.com'),
'port' => env('MAIL_PORT', 465),
'from' => ['address' => '[email protected]', 'name' => 'Shafee'],
'encryption' => env('MAIL_ENCRYPTION', 'ssl'),
'username' => env('[email protected]'),
'password' => env('MY_Gmail_API_KEY'),
'sendmail' => '/usr/sbin/sendmail -bs',
'pretend' => env('MAIL_PRETEND', false),
];
On the .env
i have :
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=465
[email protected]
MAIL_PASSWORD=MY_Gmail_API_KEY
MAIL_ENCRYPTION=ssl
The following error comes up :
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 w10sm15831823wjk.18 - gsmtp
"
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…