Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

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
CONNECTED(00000003)
(gmail's SSL certificate information)
250 ENHANCEDSTATUSCODES
ehlo example.com
250-mx.google.com at your service, [184.169.174.60]
250-SIZE 35882577
250-8BITMIME
250-AUTH LOGIN PLAIN XOAUTH XOAUTH2
250 ENHANCEDSTATUSCODES
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.)

share|improve this question

2 Answers 2

up vote 1 down vote accepted

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.

share|improve this answer
    
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 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: http://stackoverflow.com/questions/17462380/server-send-emails-using-gmail-smtp-gets-alerts

share|improve this answer
    
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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