I get a error "{ Error: Invalid login: 535-5.7.8 Username and Password not accepted." when I try send a mail with the module nodemailer from Node JS
I ran into this recently and it was related to the Less secure apps settings on the account.
Choosing "Allow users to manage their access to less secure apps" fixed it.
Turn on Allow less secure apps at https://www.google.com/settings/security/lesssecureapps
I'd the same problem earlier but after removing '@gmail.com'
from username worked fine for me.
Error '535-5.7.8 Username and Password not accepted'
occurs only in following mentioned cases:
- Wrong credentials.
- adding
@gmail.com
in the username, avoid it! - two-factor authentication enabled. If yes, then disable it.
- https://myaccount.google.com/lesssecureapps if it is OFF, turn it ON to enable lesssecureapps.