How to send html content in the Email body

murali.lancer

New member
Sep 17, 2009
3
0
0
Visit site
Hello,

I have been unable to send an email via an Intent where the email
contains HTML in the body. The email is created, but the HTML in the
body shows as plain text instead of being rendered as HTML. I have
found similar posts where others have encountered the same problem,
but so far no one has provided a solution.

Here is a snippet of code to demonstrate:

Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setType("text/html");
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]
{"t...@email.com"});
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,
"Subject");
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT,
"<html><body>Example</body></html>");
context.startActivity(Intent.createChooser(emailIntent, "Send
mail..."));


thanks and regards
murali dhuli
android developer
 

Forum statistics

Threads
947,907
Messages
6,936,727
Members
3,160,909
Latest member
craigsscully23