Hello,
To send an email, just use the code below:
//load string for email:
String[] adresses=getResources().getStringArray(R.string.mail_adresses);
String subject=getResources().getString(R.string.mail_subject);
String body=getResources().getString(R.string.mail_body);
// send an email
final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setType("plain/text");
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, adresses);
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject);
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, body);
startActivity(Intent.createChooser(emailIntent,
"Send mail..."));
Notice that you are using Intent to call the Emails' sender activity.
So, Thanks who?
Thanks, Android2ee, the Android Programming Ebooks :o)
Mathias Séguy
mathias.seguy.it@gmail.com
Auteur Android2EE
Ebooks to learn Android Programming.
No comments:
Post a Comment