I'm debugging a web application that is attempting to send email through Gmail and I'm getting rejections.

It works for a while after logging in through the browser, then starts to fail again.

What I get when I try to send email is:

$ openssl s_client -starttls smtp -connect smtp.gmail.com:587
(gmail's SSL certificate information)
ehlo example.com
250-mx.google.com at your service, []
250-SIZE 35882577
auth plain bm9ib2R5QGV4YW1wbGUuY29tAG5vYm9keUBleGFtcGxlLmNvbQBIYWhhIHRoaW5rIGFnYWluCg==
534-5.7.9 Please log in with your web browser and then try again. Learn more at
534-5.7.9 https://support.google.com/mail/bin/answer.py?answer=78754
534 5.7.9 {WEBLOGINREQUIRED} ag4sm30811879pbc.20 - gsmtp

Is there any way around this? Yes, I know the right answer is to use another service or send the mails myself, but I want to know what lockout I'm triggering.

I don't seem to be running into a rate limitation as I'm not getting the “rate limited” error (550 5.4.5 Daily sending quota exceeded.)


Use an email sending service that's designed for sending out large numbers of notifications (such as Mandrill).

Don't use Gmail to send out lots of email - they view such traffic as suspect and will mark your account as requiring manual verification when they see such traffic.

  • Do you have an affilliation with Mandrill? This reads like an advert. – Tom Brossman Aug 21 '13 at 21:49
  • Nope, not at all. It's what I've used for a few projects now and what we recommend using for sending email from Discourse. I guess it does look like the typical pattern for that, doesn't it? :) – MikeyB Aug 22 '13 at 6:12
  • Okay, fair enough. You might edit your question now to fit your answer though. You ask how to work around GMail's limitation but the answer you went with is to not use a workaround but use a completely different provider, correct? Your accepted answer does not answer your question in it's current form. – Tom Brossman Aug 22 '13 at 9:07
  • I think the question still stands as is - unless someone from Google wants to answer directly we don't really have any way of knowing. – MikeyB Aug 22 '13 at 14:29
  • @MikeyB Hey skull thanks for the mandrill. – Rahil Wazir Aug 19 '14 at 17:30

Google have to allow your app to use your own account, to allow this google provided an easy way, just go to https://accounts.google.com/DisplayUnlockCaptcha, then click continue, then with 10 min, use your application to try to send email again, and google will remember the application/service and allow your application to access your account as long as you don't change your password.

reference: https://stackoverflow.com/questions/17462380/server-send-emails-using-gmail-smtp-gets-alerts

  • What I mean by "It works for a while after logging in through the browser, then starts to fail again." is that after doing the captcha you can send email for a few minutes until gmail starts to block you again. – MikeyB Aug 21 '13 at 14:43

Try to change the account configuration at the "Access for less secure apps" option.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.