Send HTML Mail Using Android Intent

Sending HTML based email body using android intent

Google has removed that feature from gmail application so its not possible to send tag content to gmail . Alternate is you can send that data from server

Send html file as email body content using android intent

Anything that needs to go into the body can be set into your intent this way e.g. puts your builds version name as the body of the email. You can replace that with your html content. Have never tried that personally, You might need some conversion.

emailIntent.putExtra(Intent.EXTRA_TEXT, BuildConfig.VERSION_NAME);

How to send HTML email

You can pass Spanned text in your extra. To ensure that the intent resolves only to activities that handle email (e.g. Gmail and Email apps), you can use ACTION_SENDTO with a Uri beginning with the mailto scheme. This will also work if you don't know the recipient beforehand:

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

How to send HTML Mail in Android

try this

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

Send html content in mail body via intent in android

I see that you are trying to send images inserted in the html via email, unfortunately that´s not possible, you only can send the images attached to the email :(.

see this answer:
How to add an image in email body

Update:
I think this library will do the job:

http://www.example-code.com/android/smtp_EmbedImage.asp



Related Topics



Leave a reply



Submit