How can we get inline images in default email client for android through Hypertext Markup Language (HTML) ?
Position your cursor where you want the image in your message. Select Insert > Pictures. Browse your computer or online file locations for the picture you want to insert. Select the picture, then select Insert.
Embedding an image into an email message is the act of adding the image into the coding of the email template for it to appear amongst the text once the subscriber opens it, instead of appearing as an email attachment.
String body ="<html><body><table>...</table></body></html>
";
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).toString());
startActivity(Intent.createChooser(emailIntent, "Email:"));
Unfortunately, the <table>
,'img'
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.
You can not. As default Email application's doesn't support <img />
tag.
Because, ImageSpan doesn't implementing Parcelable.
Hence its failed with Intent's PUT_EXTRA.
Its works only for basic tags, like, <b>, <i>
..etc
Look at Sending html email in android using <table>, etc. - is there really no relatively built-in Intent way? and How to show an image in the email body?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With