在ACTION_SEND上设置接收者电子邮件

时间:2012-05-16 05:35:45

标签: android email

我已设置接收方电子邮件地址,但当我尝试在手机上使用时,接收方地址为空,您必须手动填写。我觉得代码很好我不知道是什么问题

CODE:
Intent mail = new Intent(android.content.Intent.ACTION_SEND);
mail.putExtra(android.content.Intent.EXTRA_EMAIL, "..@gmail.com");
mail.setType("plain/text");
startActivity(mail);

3 个答案:

答案 0 :(得分:0)

尝试填写主题,文字等所有可用选项。

final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);

emailIntent.setType("plain/text");

emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, "Receiver@gmail.com");

emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Your Subject Here");

emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Body Part here");

startActivity(emailIntent);

希望您已正确授予所有权限。

一些参考资料。 Link 1Link 2

答案 1 :(得分:0)

String[] reciver  = new String[]{
                        "reciver01@gmail.com",
                        "reciver02@gmail.com",
                         ...
                     };
mailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, reciver);

答案 2 :(得分:-1)

也许你应该在这里插入接收者电子邮件:

mail.putExtra(android.content.Intent.EXTRA_EMAIL, "receiver@gmail.com");