我需要从我的Android应用程序发送电子邮件。因此,我向电子邮件客户端应用程序发送了2个参数(电子邮件和主题),但是当应用程序打开电子邮件客户端时,仅添加了主题参数,并且未设置电子邮件参数。在Android中发送电子邮件
我该如何解决这个问题?
String getMail = email.toString();
Log.d("GET MAIL:",getMail);
String subject = "Subject";
Intent emailIntent = new Intent(Intent.ACTION_SEND);
emailIntent.putExtra(Intent.EXTRA_EMAIL, getMail);
emailIntent.putExtra(Intent.EXTRA_SUBJECT, subject);
// need this to prompts email client only
emailIntent.setType("message/rfc822");
startActivity(Intent.createChooser(emailIntent,"Choose E-mail client:"));