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
How to Apply Two CSS Classes to a Single Element
What Are the Ways to Make an HTML Link Open a Folder
Why Does My "Oninvalid" Attribute Let the Pattern Fail
Size of Font in CSS with Slash
What Is the Meaning of ? (Question Mark) in a Url String
Regular Expression to Extract Text from HTML
Preventing Firefox from Remembering the Input Value on Refresh with a Meta Tag
How to Center an Unordered List
How to Make a Display:Flex Container Expand Horizontally with Its Wrapped Contents
CSS Float: Floating an Image to the Left of the Text
Should Global CSS Styles Be Set on the HTML Element or the Body Element
Send HTML Mail Using Android Intent
:Nth-Child(Even/Odd) Selector with Class
Can You Have Multiline HTML5 Placeholder Text in a <Textarea>
Scroll to a Specific Element Using HTML
Responsive Separator For Horizontal List