sending email programmatically using default user account

前端 未结 1 768
甜味超标
甜味超标 2021-01-06 08:22

I want to be able to send an email out of my app, based on the user pressing a button on my app\'s Activity. The email needs to be sent automatically by the application upon

相关标签:
1条回答
  • 2021-01-06 08:54

    To send in the background, see the first link at your right on the list of related questions:

    You need to use an email API such as JavaMail:

    Sending Email in Android using JavaMail API without using the default/built-in app

    Update based on the comments:

    There is no way to send an email silently, without either:

    • letting the user know and accept it first (by using intents and an email provider)
    • or asking for the username and password before and using an email API as above (the user will implicitly give you the approval to send/receive emails by entering those values)

    And that is a very good thing! There are too many security concerns otherwise. If you ever find a way, please post it as a bug report in android.

    0 讨论(0)
提交回复
热议问题