There are a lot of questions and answer about this topic but none of them seems to work. I have search in Google about "send html email Android Java" and followed all links without success (from stackoverflow and from other sites). I want to send an HTML email from my android app and Gmail app. I use the next code to do it but I always get a text email:
Intent emailIntent = new Intent(Intent.ACTION_SEND_MULTIPLE);
emailIntent.setType("message/rfc822");
emailIntent.putExtra(Intent.EXTRA_SUBJECT, mysubject);
emailIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
emailIntent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
StringBuilder sbContent = new StringBuilder();
sbContent.append("<p>Text <strong>with html</strong></p>");
emailIntent.putExtra(Intent.EXTRA_TEXT, HtmlCompat.fromHtml(sbContent.toString(), HtmlCompat.FROM_HTML_MODE_LEGACY));
startActivity(Intent.createChooser(emailIntent, ""));
I've tried changing type to "text/plain", EXTRA_TEXT with EXTRA_HTML_TEXT, and some other attemps, but without success. Does anyone have an example of how to do it?