Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Howto automatically send an email on Android?

At the click of a button, my Android App generates some content and needs to email it to an address that the user has preiously configured.

Right now I'm startinmg the users preferred email app via an Intent and provide destination address, subject and content of the email as parameters. The user only has to press send.

Now I'd like to make it even more convenient for the user: Since all the data is already there and the user pressed the button to generate the email, I'd like to remove the last button to send out the email.

Is there a way to send out the email on Android without any additional user interaction ?

I know I could use SMTP directly, but then the user would have to configure all the outgoing email settings in my app. I'm looking for a way to use a existing email accounts, eg. another parameter for the intent etc.

like image 938
Gene Vincent Avatar asked May 23 '26 12:05

Gene Vincent


1 Answers

Is there a way to send out the email on Android without any additional user interaction ?

Use SMTP directly. You cannot force the user to send email on your behalf via an Intent, for obvious anti-spam reasons.

I know I could use SMTP directly, but then the user would have to configure all the outgoing email settings in my app.

Correct.

like image 197
CommonsWare Avatar answered May 25 '26 03:05

CommonsWare



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!