A Guide to Mobile and Web Technology(LAMP)

Posts tagged ‘mms’

How to send a Email attachment or MMS in Android

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("*/*")
//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:"));