I'm trying to send a custom email through new Intent(Intent.ACTION_SEND)
, containing in the email body a formatted HTML, but when selecting the Gmail application, for example, all style
of html is ignored. What I'm trying is the following:
Intent i = new Intent(Intent.ACTION_SEND);
i.setType("text/html");
i.putExtra(Intent.EXTRA_EMAIL, new String[]{"[email protected]"});
i.putExtra(Intent.EXTRA_SUBJECT, "subject of email");
i.putExtra(Intent.EXTRA_TEXT, Html.fromHtml("<h1>Sou um H1</h1><p>Eu sou um paragrafo</p><p style=\"color:red;background-color:black;\">Eu sou um paragrafo colorido!</p>"));
try {
startActivity(Intent.createChooser(i, "Send mail..."));
} catch (android.content.ActivityNotFoundException ex) {
Toast.makeText(getActivity(), "There are no email clients installed.", Toast.LENGTH_SHORT).show();
}
The email application is called correctly, but the style
part of the HTML is lost. Is it possible to keep HTML intact in this way of sending email through Intent.ACTION_SEND
?