This is my code
String to = Tothem.getText().toString();
String message = msg.getText().toString();
Intent email = new Intent(Intent.ACTION_SEND);
email.setType("image/*");
email.putExtra(Intent.EXTRA_EMAIL, new String[]{to});
email.putExtra(Intent.EXTRA_TEXT, message);
email.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
Uri uri = Uri.parse("android.resource://" + getPackageName() + "/" + R.drawable.bd2);
email.putExtra(Intent.EXTRA_STREAM, uri);
email.setType("message/rfc822");
startActivity(Intent.createChooser(email, "Choose an Email client :"));
}
but when I receive the email is with out a format, I have to select a program to open it Heres how I receive the email