How to send email from android applicationHow to send email from android application

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.setType("text/plain");
    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.", 
                                Toast.LENGTH_SHORT).show();
          }
 

SUBMIT YOUR ANSWER

  |  
 
 
 

Preview :