0

I am sending An email through Gmail. I have data in rows and Collunms . I want to send HTML table in Email throught Gmail.

                mailBody+="\n<!DOCTYPE html> \n<html>\n<body>\n<table border="+1+" style="+"width:300px"+">\n<tr>\n<td>arslan</td>\n<td>arslan</td>\n<td>asad</td>\n<td>50</td>\n</tr>\n</table>\n</body>\n</html>";

I have send mailbody in email but it didn't work. I need that receiver should get Table in Email.

M.ArslanKhan
  • 3,640
  • 8
  • 34
  • 56

1 Answers1

0

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 Links see

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

How to send HTML email

Also do check if this works on Android 4.0 and up.

Community
  • 1
  • 1