无法从我的Android应用程序发送电子邮件

时间:2011-08-08 09:24:31

标签: android email

enter image description here

我使用以下教程从我的应用程序发送电子邮件:

http://coderzheaven.com/2011/05/send-email-from-and-android-application-programatically/

但是当我尝试这样做时,我收到以下错误:

“没有应用程序可以执行此操作”

我已在下面附加了模拟器快照。请帮忙。

3 个答案:

答案 0 :(得分:2)

If you are using an emulator, you’ll need to configure the email client. If the email client is not configured, it will not respond to the Intent we’ll be discussing. If you want to see the chooser in action, you’ll need to configure a device using multiple messaging applications, such as the Gmail application and the Email application.

首先,您必须配置电子邮件客户端。

例如,将gmail帐户添加到模拟器

Settings > Accounts & Sync > Add Account > Google 

添加帐户后,运行您的代码。

答案 1 :(得分:1)

Android不提供直接发送电子邮件的API,您必须调用现有的电子邮件客户端发送电子邮件。

答案 2 :(得分:0)

您必须在模拟器(或使用它的设备)上使用帐户smtp e pop3主机配置电子邮件客户端。