Send email : Email « Network « Android






Send email

 


import android.content.Context;
import android.content.Intent;

class EmailUtilities {
  public static void send(String address, String subject, Context context, String textBody) {
    final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
    emailIntent.setType("plain/text");
    emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[] { address });
    emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject);
    emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, textBody);
    context.startActivity(Intent.createChooser(emailIntent, "Send mail..."));
  }

}

   
  








Related examples in the same category

1.Email vis Intent
2.Builds a list of the recipients email addresses each on a different line
3.Is string an Email address
4.isValidEmailAddress: Check the email address is Valid
5.Launch the email intent
6.start Email Intent
7.start Html Email Intent