I got stuck on this error I trying to configure SMTP mail on laravel
That is basically authentication error due to misconfiguration of email settings.
Go to .env
file
change
MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
to
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=465
MAIL_USERNAME=ENTER_YOUR_EMAIL_ADDRESS(GMAIL)
MAIL_PASSWORD=ENTER_YOUR_GMAIL_PASSWORD
MAIL_ENCRYPTION=ssl
The MAIL_USERNAME and PASSWORD should be replaced with your Gmail Email address and Password respectively. Login to your Google Account, Go to security settings and enable Allow Less Secure App switch button.
After that go to your project root directory and run the following command:
php artisan clear:cache && php artisan clear:config && php artisan config:cache
. Please refer to
this guide for assistance and clarification (Note: For MAIL_HOST use smtp.gmail.com)