Failed to authenticate on SMTP server error using gmail Failed to authenticate on SMTP server error using gmail laravel laravel

Failed to authenticate on SMTP server error using gmail


Did you turn on the "Allow less secure apps" on? go to this link

https://myaccount.google.com/security#connectedapps

Take a look at the Sign-in & security -> Apps with account access menu.

You must turn the option "Allow less secure apps" ON.

If is still doesn't work try one of these:

And change your .env file

MAIL_DRIVER=smtpMAIL_HOST=smtp.gmail.comMAIL_PORT=587MAIL_USERNAME=dianexxxxx@gmail.comMAIL_PASSWORD=xxxxxxMAIL_ENCRYPTION=tls

because the one's you have specified in the mail.php will only be used if the value is not available in the .env file.


Nothing wrong with your method, it's a G-mail security issue.

  1. Login g-mail account settings.

  2. Enable 2-step verification.

  3. Generate app-password.

  4. Use new-generated password in place of your real g-mail password.

Don't forget to clear cache.

php artisan config:cache.php artisan config:clear.MAIL_DRIVER=smtpMAIL_HOST=mailtrap.ioMAIL_PORT=587MAIL_USERNAME=yourgmailid@gmail.comMAIL_PASSWORD=generatedAppPasswordMAIL_ENCRYPTION=tls


If you still get this error when sending email: "Failed to authenticate on SMTP server with username "youremail@gmail.com" using 3 possible authenticators"

You may try one of these methods:

  1. Go to https://accounts.google.com/UnlockCaptcha, click continue and unlock your account for access through other media/sites.

  2. Using a double quote password: "your password" <-- this one also solved my problem.