Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use Table tag in Android Email

I want my app to construct some HTML and pass it over to an email so my user can send it to whomever they want. I found code on the web that shows how to pass the html via an Intent, but it appears that Html.fromHtml(String source) doesn't understand table tags. Is there anyway I can format an email with table tags? I want to send it through the user's preferred client instead of sending it myself with javamail.

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

Any suggestions?

like image 362
Kenny Wyland Avatar asked Dec 03 '10 21:12

Kenny Wyland


1 Answers

Unfortunately, the <table> tag isn't supported. Supported tags are actually more dependent on the email client you use to send the email - some of them are more finicky/restrictive than others. Most of them use the super-basic formatting tags like <b>, <i>, <h1>, and so on, though. The more layout-oriented tags are a lot more spotty, and some (like <table>) aren't supported at all.

like image 51
Kyle Humfeld Avatar answered Sep 26 '22 21:09

Kyle Humfeld