sending an email in android …

强颜欢笑 提交于 2019-12-11 14:44:19

问题


I am trying to send an email from my app. the code goes lik this :

Intent i = new Intent(Intent.ACTION_SEND);
i.setType("text/plain");
i.putExtra(Intent.EXTRA_EMAIL  , new String[]{"recipient@gmail.com"});
i.putExtra(Intent.EXTRA_SUBJECT, "subject of email");
i.putExtra(Intent.EXTRA_TEXT   , "body of email");
startActivity(Intent.createChooser(i, "Send mail..."));

in the emulator it shows the email client again i have to enter the recipient address, when i click send button it doesnt send .

and it is showing the messaging(MMS) context.

any help is highly appreciated ...


回答1:


here the problem was the email client was not configured in the emulator,,, It works fine in the device ...



来源:https://stackoverflow.com/questions/8518631/sending-an-email-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!