How to send email from android application

Views: 5075  |   Date: 2013-08-16 08:28:21

How to send email from email client in android.

Answer 1

Use Android default email client to send mail.

   String ToMail  = "your_mail@gmail.com";
   String message = "Test mail from android device."; 
  Intent i = new Intent(Intent.ACTION_SEND);
    i.putExtra(Intent.EXTRA_EMAIL  , new String[]{ToMail});
    i.putExtra(Intent.EXTRA_SUBJECT, "Mail From Blow Media.");
    i.putExtra(Intent.EXTRA_TEXT   , "" + message);

    try {  
          startActivity(Intent.createChooser(i, "Send mail..."));

        } catch (android.content.ActivityNotFoundException ex) {

		 Toast.makeText(getBaseContext(), "There are no email clients installed.", 

Submit Your Answer

Preview :