How to send HTML mail using Android intent

2019-02-26 06:23发布

问题:

final Intent shareIntent= new Intent(Intent.ACTION_SENDTO, Uri.parse("mailto:"));
shareIntent.putExtra(Intent.EXTRA_SUBJECT, "The Subject");
shareIntent.putExtra(
Intent.EXTRA_TEXT,
Html.fromHtml(new StringBuilder()
    .append("<p><b>Some Content</b></p>")
    .append("<small><p>More content</p></small>")
    .toString())
);

Even I have pasted this code from a solved question(How to send HTML email). Still not working in my case.

回答1:

It looks like a regression in the GMail app. It was working fine before and now it's not working anymore. It might be a bug or it might have been disabled on purpose for security reasons... Anyway I don't think you'll be able to fix this on your side