//系統郵件系統的動作為android.content.Intent.ACTION_SEND
Intent email = new Intent(android.content.Intent.ACTION_SEND);
email.setType("plain/text");
emailReciver = new String[]{"zhouyongyang122@gmail.com", "421134693@qq.com"};
emailSubject = "你有一條簡訊";
emailBody = sb.toString();
//設定郵件預設地址
email.putExtra(android.content.Intent.EXTRA_EMAIL, emailReciver);
//設定郵件預設標題
email.putExtra(android.content.Intent.EXTRA_SUBJECT, emailSubject);
//設定要預設發送的內容
email.putExtra(android.content.Intent.EXTRA_TEXT, emailBody);
//調用系統的郵件系統
startActivity(Intent.createChooser(email, "請選擇郵件發送軟體"));
帶附件:
Intent returnIt = new Intent(Intent.ACTION_SEND);
String[] tos = { "wangmeng@gmail.com" }; //send to someone
String[] ccs = { "tongyue@gmail.com" }; //Carbon Copy to someone
returnIt.putExtra(Intent.EXTRA_EMAIL, tos);
returnIt.putExtra(Intent.EXTRA_CC, ccs);
returnIt.putExtra(Intent.EXTRA_TEXT, "body");
returnIt.putExtra(Intent.EXTRA_SUBJECT, "subject");
Uri uri = Uri.parse("file:///sdcard/mysong.mp3");
returnIt.putExtra(Intent.EXTRA_STREAM, uri);
returnIt.setType("audio/mp3"); //use this format no matter what your attachment type is
returnIt.setType("message/rfc882");
Intent.createChooser(returnIt, "Choose Email Client");
startActivity(returnIt);