调用系统程序发邮件

Intent returnIt = new Intent(Intent.ACTION_SEND); String[] tos = { "[email protected]" }; //send to someone String[] ccs = { "[email protected]" }; //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);

你可能感兴趣的:(String,Stream,File,email)