启动一个Intent发邮件,指定receiver email, subject, body:
1 /** 2 * Start an activity to send an email to the given receiver, with the given subject and text body. 3 * @param receiver The receiver's email address 4 * @param subject Email subject. 5 * @param text Email body. 6 */ 7 private void sendEmail(String receiver, String subject, String text) { 8 Intent i = new Intent(Intent.ACTION_SEND); 9 i.setType("message/rfc822"); // use from live device 10 i.putExtra(Intent.EXTRA_EMAIL, new String[] {receiver}); 11 i.putExtra(Intent.EXTRA_SUBJECT, subject); 12 i.putExtra(Intent.EXTRA_TEXT, text); 13 14 startActivity(Intent.createChooser(i, getString(R.string.dialog_title_Choose_email_app))); 15 }