How to send a mail explicit intent

To send an email using an explicit intent in Android, you can use the Intent class and specify the ACTION_SENDTO action. Here's an example:

Intent intent = new Intent(Intent.ACTION_SENDTO);
intent.setData(Uri.parse("mailto:[email protected]")); // recipient's email address
intent.putExtra(Intent.EXTRA_SUBJECT, "Subject of the email");
intent.putExtra(Intent.EXTRA_TEXT, "Body of the email");

try {
    startActivity(Intent.createChooser(intent, "Send email"));
} catch (android.content.ActivityNotFoundException ex) {
    Toast.makeText(this, "There are no email clients installed.", Toast.LENGTH_SHORT).show();
}

In this example:

Note that this code will only work if an email client is installed on the device. If no email client is installed, the ActivityNotFoundException will be thrown.

You can also add additional extras to the intent to specify other email settings, such as:

For example:

intent.putExtra(Intent.EXTRA_CC, "[email protected]");
intent.putExtra(Intent.EXTRA_BCC, "[email protected]");
intent.putExtra(Intent.EXTRA_ATTACHMENT, "/path/to/file");

Keep in mind that the availability of these extras may vary depending on the email client being used.