5

Is there any way to send emails using device's Signed-in Google Account?

A similar question has been asked earlier, but didn't get enough answers or perhaps it was long ago and now a number of new APIs are available.

Previously, I had been using Intent.createChooser to prompt the user to select a mailing client and manually send mail. But this time, I want the whole process to be done without any user interaction. I don't even want to ask the user to provide one-time SMTP account details or use my own for this process.

I know, I can access AccountManager to get information about signed-in account, but can it help me to send an email without any user interaction at all (e.g. send email programmatically).

Community
  • 1
  • 1
waqaslam
  • 67,549
  • 16
  • 165
  • 178
  • 3
    If this were possible it could be misused to build a spam-app. Therefore I don't think it is supported by Android. – Henry Jan 11 '13 at 15:56
  • 1
    This may be possible with the new Gmail API: https://developers.google.com/gmail/api/ although I haven't used it myself. – Kevin Coppock Aug 07 '14 at 22:52
  • Is it ok to have 1 user interaction which is to hit the Send button? If it is ok, then it's not hard, just find the component info of gmail app, and share intent to it directly, the user will be presented with whatever you content you share. The user only need to click "Send". – uDevel Aug 07 '14 at 23:17
  • did you get the solution? – Lucem Sep 14 '18 at 07:40

1 Answers1

0

To send an email programmatically(without any user interaction) you will need to define by yourself smtp server,account,password,port and e.t.c. Check this link : Send Email Programmatically in Android

AccountManager will help you to get only the email of the user and that you will need to find your self other required parameters.

Community
  • 1
  • 1
EvZ
  • 11,889
  • 4
  • 38
  • 76
  • Thanks, but as I said, I dont want to store and use SMTP credentials for this. I'm hoping if there's any way we can use device's signed-in google-account to push the mail. – waqaslam Jan 11 '13 at 15:56