傳送 Email

Uri uri = Uri.parse("mailto:xxx@abc.com");

Intent it = new Intent(Intent.ACTION_SENDTO, uri);

startActivity(it);

Intent it = new Intent(Intent.ACTION_SEND);

it.putExtra(Intent.EXTRA_EMAIL, "me@abc.com");

it.putExtra(Intent.EXTRA_TEXT, "The email body text");

it.setType("text/plain");

startActivity(Intent.createChooser(it, "Choose Email Client"));

Intent it=new Intent(Intent.ACTION_SEND);

String[] tos={"me@abc.com"};

String[] ccs={"you@abc.com"};

it.putExtra(Intent.EXTRA_EMAIL, tos);

it.putExtra(Intent.EXTRA_CC, ccs);

it.putExtra(Intent.EXTRA_TEXT, "The email body text");

it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text");

it.setType("message/rfc822");

startActivity(Intent.createChooser(it, "Choose Email Client"));

//傳送影音附件檔

Intent it = new Intent(Intent.ACTION_SEND);

it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text");

it.putExtra(Intent.EXTRA_STREAM, Uri.parse("file:///sdcard/mysong.mp3"));

it.setType("audio/mp3");

startActivity(Intent.createChooser(it, "Choose Email Client"));

//傳送圖片附件檔

Intent it = new Intent(Intent.ACTION_SEND);

it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text");

it.putExtra(Intent.EXTRA_STREAM, Uri.parse("file:///sdcard/mypic.jpg"));

it.setType("image/jpeg");

startActivity(Intent.createChooser(it, "Choose Email Client"));