By Dennis79
Hi guys,
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_USERNAME=xxxl@gmail.com
MAIL_PASSWORD=xxx -> App password
MAIL_FROM_ADDRESS=xxx@gmail.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!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hey friend,
While I can’t get you through to the end result, I can help you to at least know that there is no DigitalOcean specific configuration required here, and that firewall adjustments will not be relevant. In this case it seems that your droplet is actively reaching out to Google to authenticate, and Google is telling you that what you are sending is incorrect.
Given that information, I think I would focus more heavily on making sure that what you think you’re sending is what you’re actually sending, and that this information is accepted for SMTP authentication on the other side. It sounds overly simplistic, my honest feeling is that it probably is. It’s the simplest things that often escape us, even looking over it I can’t accurately say what exactly it is that is wrong (just what it isn’t).
Jarland
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.