Send Email to Multiple Addresses Android

SoH picture SoH · Mar 15, 2012 · Viewed 8.6k times · Source

I want to select a number of email addresses and then send an email to all of them.

My code is as below:

emailIntent .putExtra(android.content.Intent.EXTRA_EMAIL,new String[]{listofemailaddresses});
emailIntent .putExtra(android.content.Intent.EXTRA_SUBJECT, "My Subject");
emailIntent .putExtra(android.content.Intent.EXTRA_TEXT, Constants.SMS_MESSAGE);
this.startActivity(Intent.createChooser(emailIntent, "Send mail..."));`

listofemailaddresses is a string which contains all the emails separated by a ',' sign. But the To field is always empty in this.

Answer

akkilis picture akkilis · Mar 15, 2012

Add this line to your code:

emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL,
            new String[] { "appsupport@YOUR_DOMAIN.com" });

This will fill the "To" section of your screen.