Send Mail using OAuth and SMTP

26 views
Skip to first unread message

mahmoud...@gmail.com

unread,
Jul 18, 2011, 5:43:11 AM7/18/11
to Google Apps Domain Information and Management APIs, samuel...@hindawi.com, mahmoud...@hindawi.com
Hello,

We have been trying to use 2-legged OAuth authentication mechanism
with Gmail SMTP to send emails. We were able to send authenticate
successfully and send emails. However, we faced a strange problem
where the authentication does not work every time instead it randomly
gives the following error "535-5.7.1 Username and Password not
accepted. Learn more at ".

Thanks,
Samuel

Jay Lee

unread,
Jul 18, 2011, 10:40:07 AM7/18/11
to google-app...@googlegroups.com, samuel...@hindawi.com, mahmoud...@hindawi.com
Random failures with OAuth are often due to the time being somewhat off on the sending machine. Verify that the server's time is exactly correct, try syncing it with an Internet time server for best results going forward.

Another possibility is that some of the accounts have not accepted the Terms of Service. I believe SMTP, IMAP and POP connections will fail for an account until the user logs into the web interface and accepts the ToS / completes the Captcha.

Jay

MK++++

unread,
Jul 19, 2011, 2:34:30 AM7/19/11
to Google Apps Domain Information and Management APIs
We are having the same problem too, but neither of your suggestions
are correct in our case. Any thoughts?

NA NA

unread,
Jul 19, 2011, 4:29:16 AM7/19/11
to Google Apps Domain Information and Management APIs
Hello,

We tried synchronizing the sending machine time but still having the
same issue. Also, we already use the web interface to access the
sending accounts. So, any suggestions?

Thanks,
Samuel

On Jul 18, 4:40 pm, Jay Lee <jay0...@gmail.com> wrote:

Jay Lee

unread,
Jul 19, 2011, 6:31:54 AM7/19/11
to google-app...@googlegroups.com
Do you (or NA NA) see the random failures with the OAuth SMTP/IMAP Code Samples here?


can you establish any sort of pattern with the failures? Do certain users always fail? Never fail? Fail X % of the time?

Jay

MK++++

unread,
Jul 23, 2011, 10:04:32 PM7/23/11
to Google Apps Domain Information and Management APIs
@Jay
Surprise! The sample is always giving INVALID CREDENTIALS with 2-
legged oauth.
SCREW Google.

Any thoughts?

MK++++

unread,
Jul 23, 2011, 10:07:15 PM7/23/11
to Google Apps Domain Information and Management APIs
Oh, and before blaming me for missing something, why don't you try it
yourself????

I was using the Python example code.

Any thoughts?

On Jul 19, 6:31 am, Jay Lee <jay0...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages