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
"
Use tls instead of ssl and use port 587.
Use key or paasword.
Or Please run php artisan config:cache
Or Try to turn on "less secure apps" of your account on this page.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With