// The action of the system email system is 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 = "you have a text message ";
Emailbody = sb. tostring ();
// Set the default email address
Email. putextra (Android. content. Intent. extra_email, emailreciver );
// Set the default email title
Email. putextra (Android. content. Intent. extra_subject, emailsubject );
// Set the content to be sent by default
Email. putextra (Android. content. Intent. extra_text, emailbody );
// Call the system's email system
Startactivity (intent. createchooser (email, "select email sending software "));
With attachment:
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 );