Reputation: 7249
I'm using Gmail for my application to send an email, but when it tried to send an email, Gmail returned the error message "Failed to authenticate on SMTP server with username " " using 3 possible authenticators. Authenticator LOGIN returned Expected response code 235 but got code "535", with the message "535-5.7.8 Username and Password not accepted." I am using Google Workplace so emails are sent with my business's domain name. There is a generic Gmail account for sending emails, and its Gmail SMTP config information is good in the application. Why isn't this working and what's the fix?
Upvotes: 3
Views: 5974
Reputation: 7249
That Gmail address/account needs to allow "less secure app access," but there is an extra layer of complexity because it is a Google Workspace account, and the Workspace administrator has to enable that first.
Go to "Security Setting" and, in "Less Secure Apps," click on "Allow users to manage their access to less secure apps"
You may also have to "Allow users to turn on 2-Step Verification" in "Security Settings"
Then, go to https://myaccount.google.com/u/1/security, log in with the email address and PWD sending the emails, go to "Security," and enable "Less secure app access"
Upvotes: 8
Reputation: 4746
Since May 30, 2022 Google cancelled the "Less secure app access", so @Andew's answer is not relevant.
The update answer is to use App Passwords:
An App Password is a 16-digit passcode that gives a less secure app or device permission to access your Google Account. App Passwords can only be used with accounts that have 2-Step Verification turned on.
Upvotes: 2