Uri email android developer

Here is the URI for an email address in Android:

mailto:<email_address>?subject=<subject>&body=<body>

Here:

For example:

mailto:[email protected]?subject=Hello&body=This%20is%20a%20test%20email

This URI will open the default email client on the device and compose a new email with the specified subject and body.

You can also add additional parameters to the URI to customize the email composition experience. Some common parameters include:

For example:

mailto:[email protected][email protected]&[email protected]&subject=Hello&body=This%20is%20a%20test%20email&attachment=file.txt

This URI will open the default email client on the device and compose a new email with the specified subject, body, and attachment.

You can use this URI in your Android app by using the Intent class to launch the email client. For example:

Intent intent = new Intent(Intent.ACTION_SENDTO);
intent.setData(Uri.parse("mailto:[email protected]?subject=Hello&body=This%20is%20a%20test%20email"));
startActivity(intent);

This code will launch the default email client on the device and compose a new email with the specified subject and body.