当我尝试发送电子邮件意图时,无论我使用的是INTENT.ACTION_SEND还是ACTION.SENDTO并使用股票索尼Xperia Active电子邮件客户端主题和收件人显示正常但身体是空的,除了粘贴的标准评论客户端.在我的三星galaxy Note 2上,相同的代码就像魅力一样.
if(mPrefs.getBoolean("alternative_email_clIEnt", false)){ Intent send = new Intent(Intent.ACTION_SENDTO); String uriText = "mailto:" + Uri.encode(emailStrings[6]) + "?subject=" + Uri.encode("The subject") + "&body=" + Uri.encode(emailBody); Uri uri = Uri.parse(uriText); send.setData(uri); startActivity(Intent.createChooser(send, "Email verschicken")); } else { Intent send = new Intent(Intent.ACTION_SEND); send.putExtra(Intent.EXTRA_EMAIL, emailStrings[6]); send.putExtra(Intent.EXTRA_SUBJECT, "The Subject"); send.putExtra(Intent.EXTRA_TEXT, emailBody); startActivity(Intent.createChooser(send, "Email verschicken")); }
解决方法:
要发送包含正文的电子邮件,请使用message / rfc822.
Intent sendIntent = new Intent(Intent.ACTION_SEND);sendIntent.setType("message/rfc822");sendIntent.putExtra(Intent.EXTRA_EMAIL, new String[] { "[email protected]", "[email protected]" });sendIntent.putExtra(Intent.EXTRA_SUBJECT, "Subject of the email");sendIntent.putExtra(Intent.EXTRA_TEXT, "Content of the email");startActivity(sendIntent);
希望这可以帮助.
总结以上是内存溢出为你收集整理的android – 使用Intent时不显示电子邮件正文全部内容,希望文章能够帮你解决android – 使用Intent时不显示电子邮件正文所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)