Sending html email in android using , etc. - is there really no relatively built-in Intent way?
后端 未结 1 470
离开以前
离开以前 2020-11-30 08:05

I have read a good bit on the limitations of sending html email from android. All suggestions to send html email seem to be to just pass Html.fromHtml(yourHtmlString) to th

1条回答
  •  一生所求
    2020-11-30 08:28

    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".

    0 讨论(0)
提交回复
热议问题