4
votes

Every few days, google apps starts rejecting my username and password with :

SMTPAuthenticationError: (535, '5.7.1 Username and Password not accepted. Learn more at\n5.7.1 http://mail.google.com/support/bin/answer.py?answer=14257 22sm439603yxe.15')

If I go to the google apps login page and try my password, it asks for a captcha. Filling it out correctly, now allows me to send email again for a few days until this happens again.

How can I stop this from happening? Has anyone else seen this when sending automated emails through google apps?

I'm sending registration emails from my website using these settings in django :

EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = '*secret*'
EMAIL_USE_TLS = True
3
I really hope your password is not 'secret' :-)Franci Penov
I find that the captcha request appears when the email password fails a few times. You could try changing the email id (incase someone ese is trying to guess your pass, or you have an app set with the wrong password), and following google's instructions at mail.google.com/support/bin/answer.py?hl=en&answer=14257 and see if that resolves the problem.Alterlife
Unless you say what is the password you enter, it is hard to find why ;)lprsd
@Alterlife ok, I'll try changing accounts since [email protected] is easy to guess. @becomingGuru, you better not be the one trying to guess my password ;)Paul Tarjan

3 Answers

2
votes

You should throttle your requests to an acceptable rate for Google Apps.

I am not sure if Google has an official statement/guidance about what is the acceptable request rate, though. If you can't find any such public statement/guidance, you should contact Google Apps support to see if you can get it through there.

0
votes

The maximum limit for sending emails for a given email account per day is 3000. But it is unlikely that you are sending as many emails every day. Even the error message isn't indicating that.

While, the resolution to the actual question can only be resolved by google, the way to circumvent this problem may be by setting up different email users, and choosing one at random.

0
votes

Use OAuth2:

Explained at http://www.nodemailer.com/

Gmail has came up with the concept of 'less secure' apps which is basically anyone who uses plain password to login to Gmail, so you might end up in a situation where one username can send (support for 'less secure' apps is enabled) but other is blocked (support for 'less secure' apps is disabled).

To prevent having login issues you should either use XOAUTH2 or use another provider and preferably a dedicated one like Mailgun or SendGrid