我正在尝试使用intent /questions/tagged/intent从我的应用程序发送电子邮件,但电子邮件的“收件人”字段不会填充。如果我添加代码来填写主题或文本,它们就可以正常工作。仅“收件人”字段不会填充。
我也尝试将类型更改为“text/plain”和“text/html”,但我遇到了同样的问题。有人可以帮忙吗?
public void Email(){
Intent emailIntent = new Intent(Intent.ACTION_SEND);
emailIntent.setType("message/rfc822"); //set the email recipient
String recipient = getString(R.string.IntegralEmailAddress);
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL , recipient);
//let the user choose what email client to use
startActivity(Intent.createChooser(emailIntent, "Send mail using...")); }
我尝试使用的电子邮件客户端是 Gmail
我认为你没有通过recipient
as array of string
它应该像
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL,new String[] { "[email protected] /cdn-cgi/l/email-protection" });
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)