Skip to content Skip to sidebar Skip to footer

How To Send An Email In Android 2.2?

I want to send an email with android 2.2. First I made an intent chooser with an ACTION_SEND to select which to use : Intent intent = new Intent(Intent.ACTION_SEND); intent.setT

Solution 1:

This code will shows only the email clients,

Intentemail=newIntent(Intent.ACTION_SEND);
    email.putExtra(Intent.EXTRA_EMAIL, newString[]{"youremail@yahoo.com"});          
    email.putExtra(Intent.EXTRA_SUBJECT, "subject");
    email.putExtra(Intent.EXTRA_TEXT, "message");
    email.setType("message/rfc822");
    startActivity(Intent.createChooser(email, "Choose an Email client :"));

Solution 2:

You might want to checkout following (to get what you are looking at the end, i.e. "....By the way, I'll want to do it for messaging too so that in the end I can have 2 buttons: "): http://www.jondev.net/articles/Sending_Emails_without_User_Intervention_%28no_Intents%29_in_Android

or also you could checkout: Android email chooser

Kind regards, Bo

Post a Comment for "How To Send An Email In Android 2.2?"