Mar 23, 2011

Send email by startActivity with Intent.ACTION_SEND

Here is a example by calling startActivity() with Intent.ACTION_SEND. Android OS will start a app Chooser suitable for "plain/text" email sending.

    String emailList[] = {emailAddress1, emailAddress2, ...};

Intent intent = new Intent(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_EMAIL, emailList);
intent.putExtra(Intent.EXTRA_SUBJECT, "Email Subject");
intent.putExtra(Intent.EXTRA_TEXT, "Email Text");
startActivity(Intent.createChooser(intent, "Choice email App"));

No comments:

Post a Comment

Infolinks In Text Ads