Somehow I managed to get AuthToken from Google
in Android. Now I can't find how could I use this token to send email using the email id and the authToken without user interaction.
Please provide some example.
You cannot send emails using Gmail programmatically unless you use SMTP or IMAP which in their standard form use password authentication.
However, there is an experimental GMail API that's based on OAuth (XAOUTH SASL) which you can use with SMTP AUTH
command to authenticate to Gmail servers using standard 3 legged OAuth. With this, you should get a short lived token that you can use for sending emails. I haven't tried this on Android but I don't see why it shouldn't work:
http://code.google.com/apis/gmail/oauth/protocol.html
So, you can download the client libraries for this GMail API alongwith Java Mail and give it a try! There is a sample bundled which you can use for a quick proof of concept.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With