Monday, 28 November 2011

How to send the email from Android application


The mail is use the default android mail from ur application.
Activity Action. Deliver some data to someone else.who the data is being delivered to is not specified.
Intent intent = new Intent(Intent.ACTION_SEND);

In this you will specify which type of data you are sending.
intent.setType("plain/text");

In this emailAddressList  you have to give the mail address of the receipent
intent.putExtra(Intent.EXTRA_EMAIL, emailAddressList);

In this emailSubject you will specify the subject of that perticular sending mail.
intent.putExtra(Intent.EXTRA_SUBJECT, emailSubject);

emailText is like body of the email the content which you want to send.
intent.putExtra(Intent.EXTRA_TEXT, emailText);


Convenience function for creating a ACTION_CHOOSER  Intent. Parameters
target The Intent that the user will be selecting an activity
 to perform. title Optional title that will be displayed in the
 chooser.
startActivity(Intent.createChooser(intent, "SalesApp will send the mail"));

No comments:

Post a Comment