发送电子邮件的自动编程 [英] Send auto email programmatically
问题描述
我想以编程方式发送电子邮件。
我尝试了以下code。
最终意图emailIntent =新的意图( android.content.Intent.ACTION_SEND);
emailIntent.setType(纯/文); emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, 新的String [] {abc@gmail.com}); emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, 电子邮件主题); emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, 电子邮件正文); startActivity(Intent.createChooser( emailIntent,发送邮件...));
但问题是,在发送电子邮件之前的应用程序打开的活动
我想直接发送电子邮件,而不开放撰写活动。这怎么可能?
看的链接,对于你的问题的答案。
<一个href="http://stackoverflow.com/questions/2020088/sending-email-in-android-using-javamail-api-without-using-the-default-android-ap/2033124#2033124">不使用默认的Android应用程序(内建电子邮件应用程序)
发送电子邮件在Android中使用JavaMail APIi want to send email programmatically.
i tried out the following code.
final Intent emailIntent = new Intent( android.content.Intent.ACTION_SEND);
emailIntent.setType("plain/text"); emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[] { "abc@gmail.com" }); emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Email Subject"); emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Email Body"); startActivity(Intent.createChooser( emailIntent, "Send mail..."));
but problem is that before sending email the application open the activity
i want to send email directly without open compose activity. how this possible?
Look at the link, there is an answer for your question.
这篇关于发送电子邮件的自动编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!