Andorid 调用其他app发送Email。
- Intent.ACTION_SENDTO
// 1. 注意使用 Uri.encode()
Uri uri = Uri.parse("mailto:" + email
+ "?subject=" + Uri.encode(subject)
+ "&body=" + Uri.encode(content));
Intent emailIntent = new Intent(Intent.ACTION_SENDTO, uri);
- Intent.ACTION_SEND, 有一些其他非email类的app也会弹出来
Intent emailIntent = new Intent(Intent.ACTION_SEND);
emailIntent.setType("text/html");
emailIntent.putExtra(Intent.EXTRA_EMAIL, new String[]{email});
emailIntent.putExtra(Intent.EXTRA_SUBJECT, subject);
emailIntent.putExtra(Intent.EXTRA_TEXT, content);
参考:
stackoverflow
网友评论