编程发送电子邮件使用默认的用户帐户
我希望能够发送电子邮件从我的应用程序,可以根据用户pressing在我的应用程序的活动按钮。电子邮件需要通过按钮时preSS应用程序自动发送的,即我不想显示另一封电子邮件形式提供给用户。和电子邮件应发的的使用手机上的用户的默认电子邮件帐户的不是一个电子邮件帐户,我很难code到我的应用程序。而且我不希望在他们的电子邮件证书用户密钥到我的应用程序的配置,我只是想能够调用一些Android的API,并说这个主题和正文此电子邮件地址发送这封电子邮件,使用默认的帐户用户设置了电话。
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 button press, i.e. I dont want to show another email form to the user. And the email should be sent using the user's default email account on the phone not an email account that I hardcode into my app. And I dont want to have the user key in their email credentials into my app's configuration, I just want to be able to call some android api and say "send this email with this subject and body to this email address, using the default account that the user has set up on the phone".
这可能吗?如果是这样,怎么样?
Is this possible? If so, how?
在此先感谢......
Thanks in advance......
要发送的背景下,看到的相关问题清单上你的右边的第一个链接:
To send in the background, see the first link at your right on the list of related questions:
您需要使用电子邮件API如JavaMail的:
You need to use an email API such as JavaMail:
Sending电子邮件在Android中使用JavaMail API不使用默认的Android应用程序(内建电子邮件应用程序)
根据的评论更新:
有没有办法来默默发送一封电子邮件,没有任何
- 让用户知道并首先接受它(通过使用意图和电子邮件提供商)
- 或询问之前的用户名和密码,并使用电子邮件API如上(用户将隐含给你审批发送/输入的数值接收电子邮件)
这是一件非常好的事情!有太多的安全问题,否则。如果你找到一种方法,请张贴在Android的一个bug报告。
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.