Jun 18, 2011

Sending Email From Android (Code Snippet)

Sending Email from Android via Java Code is not very complex if you configure the Email perfectly in your emulator or device. Keeping that in mind I will give you the code snippet below for sending E-mail:

1. Just create a button in the XML layout file and then paste the code below in your Activity class:
// Comment
public void chooseEmail(View button) {

  Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
  startActivity(Intent.createChooser(emailIntent, getResources().getString(R.string.chooser)));


1 comment:

  1. Thanks for the code snippet Mohammad, was really useful.. Even this http://www.compiletimeerror.com/2013/07/send-email-in-android-example.html might help, have a look..