编程发送电子邮件使用默认的用户帐户 [英] sending email programatically using default user account

查看:264
本文介绍了编程发送电子邮件使用默认的用户帐户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够发送电子邮件从我的应用程序,可以根据用户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:

<一个href="http://stackoverflow.com/questions/2020088/sending-email-in-android-using-javamail-api-without-using-the-default-android-app">Sending电子邮件在Android中使用JavaMail API不使用默认的Andr​​oid应用程序(内建电子邮件应用程序)

根据的评论更新:

有没有办法来默默发送一封电子邮件,没有任何

  • 让用户知道并首先接受它(通过使用意图和电子邮件提供商)
  • 或询问之前的用户名和密码,并使用电子邮件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.

这篇关于编程发送电子邮件使用默认的用户帐户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆