4 个 TextView 和一个按钮出现在我的应用程序屏幕中。 我如何将 TextView 中存在的数据作为电子邮件发送到用户帐户。
最佳答案
Intent email = new Intent(Intent.ACTION_SEND);
email.putExtra(Intent.EXTRA_EMAIL, new String[]{"myemail@xyz.com"});
email.putExtra(Intent.EXTRA_SUBJECT, "subject");
email.putExtra(Intent.EXTRA_TEXT, "message");
email.setType("message/rfc822");
try {
startActivity(Intent.createChooser(email, "Choose an Email client :"));
}
catch (android.content.ActivityNotFoundException ex) {
Toast.makeText(MyActivity.this, "There are no email clients installed.", Toast.LENGTH_SHORT).show();
}
有关详细说明,请查看 this tutorial .
关于android - 如何向android中的用户电子邮件帐户发送电子邮件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12528331/