Luciano
Luciano

Reputation: 2798

Is it possible to send html with the mail intent?

is it possible to send html with the mail intent. I've seen some questions about this, but they are al answered with something like this:

        final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
        emailIntent.setType("text/html");
        emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, titleString);
        emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, Html.fromHtml(htmlString));
        startActivity(Intent.createChooser(emailIntent, "Email:"));

I'm trying to send some data in a table but the Html.fromHtml will remove my table layout..

Is there any other option to send a html content type email...?

Upvotes: 2

Views: 2399

Answers (2)

Luciano
Luciano

Reputation: 2798

Solved it by the following work-around:

Create a html file and send it as a attachment..

Upvotes: 1

logcat
logcat

Reputation: 3474

create email body with tags, that are supported by android.text.Html. https://github.com/android/platform_frameworks_base/blob/master/core/java/android/text/Html.java

Upvotes: 1

Related Questions