Search...

Friday, April 20, 2012

How to send email in Android?


    Intent sendIntent = new Intent(Intent.ACTION_SEND);
// Set Address for Email
sendIntent.putExtra(Intent.EXTRA_EMAIL, mailto);
// Set Subject for Email
sendIntent.putExtra(Intent.EXTRA_SUBJECT, "Test");

sendIntent.putExtra(Intent.EXTRA_TEXT, "Expense Category:");

// Attach picture to email
Uri imageFile = Uri.parse("file://" + imagePath);
sendIntent.putExtra(Intent.EXTRA_STREAM, imageFile);

startActivity(Intent.createChooser(sendIntent, "Choose your e-mail"));

No comments:

Post a Comment