A Guide to Mobile and Web Technology(LAMP)

The following lines of code are used to send a image as either mail attachment
or as MMS from the android mobile programatcally!


Intent sendIntent = new Intent(Intent.ACTION_SEND);
//Mime type of the attachment (or) u can use sendIntent.setType("*/*")
sendIntent.setType("image/jpeg");
//Subject for the message or Email
sendIntent.putExtra(Intent.EXTRA_SUBJECT, "My Picture");
//Full Path to the attachment
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://sdcard/test.png"));
//Use a chooser to decide whether email or mms
startActivity(Intent.createChooser(sendIntent, "Email:"));

Comments on: "How to send a Email attachment or MMS in Android" (3)

  1. nice article
    i mark it.

  2. Thanks waleed 🙂

  3. Hi, i tried this example code , but it is promting to select application to send. Can u send me code which automatically sends image in the form of mms or email

    Thanks,
    Mano.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: