Question

Im developing a mobile application using PhoneGap. In this application the user should be able to click a link to send an email from there and this email should contain HTML data. So what I have is something like this:

JS:

var mail = "<html><body><h1>Testing HTML Email</h1></body></html>"
$("#mailTo").attr("href", "mailto:?subject=Star&body=" + mail);

HTML (PhoneGap):

<a id="mailTo" href="#">Email</a>

When I click the link, the Gmail app on my phone (Im using android) opens with the content of the variable mail but it is not interpreted as HTML. I would like to know if there is a way to do so (set headers or something like that). Thanks in advance.

Was it helpful?

Solution

No, according to the specification the body is meant to be text/plain:

The special hname "body" indicates that the associated hvalue is the body of the message. The "body" hname should contain the content for the first text/plain body part of the message. The mailto URL is primarily intended for generation of short text messages that are actually the content of automatic processing (such as "subscribe" messages for mailing lists), not general MIME bodies.

https://www.rfc-editor.org/rfc/rfc2368

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top