Sending HTML Email in Android Using <Table>, etc. - Is There Really No Relatively Built-In Intent Way

Sending html email in android using table, etc. - is there really no relatively built-in Intent way?

This works for a few basic tags - bold, italic - but won't for anything like an html table.

That is a function of the email client, most likely. Not all email clients can author arbitrary HTML, on any platform. So, while Mozilla Thunderbird appears to let you create an HTML mail with a table, Gmail does not (leastways, I don't see an option for it in the message-compose window).

I am wondering if there is not a more fundamental limitation that will force you to do something completely different

Unless you write your own email client, extending the several classes needed to allow TextView and EditText to handle HTML tables (it's way more than just the Html class) will do you no good.

and I am wondering if the gmail app looks under the covers to see what the charsequence really is and then can handle a few tags

TextView and EditText can "handle a few tags", lining up roughly with what Html can parse/generate and SpannedString can represent.

None of that can handle an HTML table. Nor JavaScript. Nor CSS. Nor iframe or any number of other tags.

but in the end you've got to bite the bullet and implement a lot of lower level stuff yourself

I'd start by asking yourself whether sending HTML mail with tables from the phone directly is worth it. You could send HTML mail with tables from your server using a Web service interface, or you could send HTML mail sans tables from the phone. Neither of those would require you to collect "the pw stuff".

Embed html table tag in email intent android

try below code :-

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())
);

for more info see below link:-

android - How to format the text as table in email body of email client

How to send HTML email

http://blog.iangclifton.com/2010/05/17/sending-html-email-with-android-intent/



Related Topics



Leave a reply



Submit