2010-03-02

How to call the native email client in an Android phone from an application

Write down the following piece of code where you want to call the email client.

 

final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);

emailIntent.setType("plain/text");

emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[] { recipient_email_address });

emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, emailSubject);

emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailBody);

startActivity(Intent.createChooser(emailIntent, messageYouwantToDisplay));

No comments: