You are here

Send data to someone

Action (WebIntents):
type of the intent is the MIME type of the data being sent. get*Extra can have either a EXTRA_TEXT or EXTRA_STREAM field, containing the data to be sent. If using EXTRA_TEXT, the MIME type should be "text/plain"; otherwise it should be the MIME type of the data in EXTRA_STREAM. Use */* if the MIME type is unknown (this will only allow senders that can handle generic data streams). Optional standard extras, which may be interpreted by some recipients as appropriate, are: EXTRA_EMAIL, EXTRA_CC, EXTRA_BCC, EXTRA_SUBJECT.

Deliver some data to someone else.

Who the data is being delivered to is not specified; it is up to the receiver of this action to ask the user where the data should be sent.

This intent is described originally at

Status of intents protocol: 


See the discussion on MIME types for mail.

Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, "email text");
sendIntent.putExtra(Intent.EXTRA_SUBJECT, "Subject");
startActivity(Intent.createChooser(sendIntent, "Title:"));

To send a file attachment from the SD card use the following code:

Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_STREAM, "file:///sdcard/mysong.mp3");
sendIntent.putExtra(Intent.EXTRA_SUBJECT, "Subject");
startActivity(Intent.createChooser(sendIntent, "Title:"));

setType should set the MIME type of the file being sent.
A list of commonly used extensions and corresponding MIME types is included in the OI File Manager mimetypes.xml.

PS: In your application, you can easily obtain the file name by calling the PICK FILE intent of the OI File Manager.

For the built-in MMS application, the following undocumented extras may be useful:

See current source code:;a=blob;f...

mExternalAddress = intent.getStringExtra("address");
mExitOnSent = intent.getBooleanExtra("exit_on_sent", false);
mMsgText = intent.getStringExtra("sms_body");
String subject = intent.getStringExtra("subject");

As mentioned in this Stack Overflow thread, files have to be attached as sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file:///sdcard/mysong.mp3"));
You need the extra / in file:/// (missing in the Stack Overflow post) as otherwise GMail drops the attachment just before sending stating the file path is wrong.