Uri email android
Here are some common URI schemes for email on Android:
mailto
: This is the most common URI scheme for email on Android. It allows you to open the default email app on the device and compose a new email.
Example: mailto:[email protected]
mailto:[email protected]?subject=Hello&body=This%20is%20a%20test%20email
This URI scheme allows you to specify the recipient, subject, and body of the email.
mailto:[email protected]?subject=Hello&body=This%20is%20a%20test%20email&[email protected]&[email protected]
This URI scheme allows you to specify additional recipients (CC and BCC) in addition to the subject and body.
mailto:[email protected]?subject=Hello&body=This%20is%20a%20test%20email&attachment=file.txt
This URI scheme allows you to attach a file to the email.
mailto:[email protected]?subject=Hello&body=This%20is%20a%20test%20email&attachment=file.txt&attachment=file2.txt
This URI scheme allows you to attach multiple files to the email.
Note: The %20
in the URI scheme is a URL-encoded space character. You can use this scheme in your Android app to open the default email app and compose a new email.
Here is an example of how you can use the mailto
URI scheme in your Android app:
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 open the default email app on the device and compose a new email with the specified subject and body.