public static void sendInfoByEmail(Context context, String sendContent,
String subject, String[] emailReciver, String type) {
// 系统邮件系统的动作为android.content.Intent.ACTION_SEND
Intent email = new Intent(android.content.Intent.ACTION_SEND);
if (type == null) {
type = "plain/text";
}
email.setType(type);
// 设置邮件默认地址
if (emailReciver != null && emailReciver.length != 0) {
email.putExtra(android.content.Intent.EXTRA_EMAIL, emailReciver);
}
// 设置邮件默认标题
email.putExtra(android.content.Intent.EXTRA_SUBJECT, subject);
// 设置要默认发送的内容
email.putExtra(android.content.Intent.EXTRA_TEXT, sendContent);
// 调用系统的邮件系统
context.startActivity(Intent.createChooser(email, "请选择邮件发送软件"));
}
发送邮件
最新推荐文章于 2025-05-20 10:37:01 发布