Send email from Android using Intent


/ Published in: Java
Save to your folder(s)



Copy this code and paste it in your HTML
  1. Intent i = new Intent(Intent.ACTION_SEND);
  2. //i.setType("text/plain"); //use this line for testing in the emulator
  3. i.setType("message/rfc822") ; // use from live device
  4. i.putExtra(Intent.EXTRA_EMAIL, new String[]{"[email protected]"});
  5. i.putExtra(Intent.EXTRA_SUBJECT,"subject goes here");
  6. i.putExtra(Intent.EXTRA_TEXT,"body goes here");
  7. startActivity(Intent.createChooser(i, "Select email application."));

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.