Laravel sending mail fails on droplet: 535-5.7.8 Username and Password not accepted
I’ve build a Laravel project, but I’m stuck in sending emails using Gmail in the droplet. Locally it’s working fine.
I’m getting this error:
Expected response code 250 but got code "535", with message "535-5.7.8 Username and Password not accepted
I’ve tried to remove 2-way auth, setting “less secure app on on your gmail account”, but nothing helps
I’m using Ubuntu 18.04.
Settings in Laravel:
MAIL_DRIVER=smtp MAIL_HOST=smtp.gmail.com MAIL_PORT=587 MAIL_USERNAMEfirstname.lastname@example.org MAIL_PASSWORD=xxx -> App password MAIL_FROM_ADDRESSemail@example.com MAIL_FROM_NAME=xxx MAIL_ENCRYPTION=tls
As it is working locally, do I have to add some extra setting for Digital Ocean or my setup/firewall (UFW) ?
Hope you can help me. Thanks in advance!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.×