문제

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 = 'metaward@metaward.com'
EMAIL_HOST_PASSWORD = '*secret*'
EMAIL_USE_TLS = True
도움이 되었습니까?

해결책

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.

다른 팁

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.

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top