-1

这是我用来发送电子邮件的代码..但是当我运行它时,我添加的 TO 地址字符串没有显示在屏幕上..没有收到任何错误..

Intent emailIntent = new Intent(Intent.ACTION_SEND);
emailIntent.setType(HTTP.PLAIN_TEXT_TYPE);
emailIntent.putExtra(Intent.EXTRA_EMAIL, new String[] {"ashwin.innodea@gmail.com"}); // recipients
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Email subject");
emailIntent.putExtra(Intent.EXTRA_TEXT, "Email message text");
startActivity(emailIntent);
4

1 回答 1

0

像这样试试

Intent email = new Intent(Intent.ACTION_SEND);
email.putExtra(Intent.EXTRA_EMAIL, new String[]{"ashwin.innodea@gmail.com"});         
email.putExtra(Intent.EXTRA_SUBJECT, "Email subject");
emailIntent.putExtra(Intent.EXTRA_TEXT, "Email message text");
email.setType("message/rfc822");
startActivity(Intent.createChooser(email, "Choose an Email client :"));
于 2013-02-18T06:45:36.753 回答