Sending HTML in mailto anchor tag
Asked Answered
F

4

9

I have an anchor tag on my web page that is currently defined as:

<a href="mailto:[email protected]?subject=Welcome&body=Check this out, please click <a href='http://example.com'>here</a>">Send to a Friend</a>

As this link demonstrates, I'm trying to send some HTML in an email when a user clicks a link. However, when the text opens in the email editor, it is displayed as pure text. How do I get it to be in HTML format?

Farmhouse answered 2/7, 2010 at 13:0 Comment(0)
P
12

The body part is supposed to be text/plain according to RFC 2368

Is it possible to add an HTML link in the body of a MAILTO link

Pinwork answered 2/7, 2010 at 13:34 Comment(0)
P
2

I'm pretty sure this is impossible.

Phalansterian answered 2/7, 2010 at 13:1 Comment(1)
...and rightfully so; if this were possible, it would be a pretty major security hole.Banksia
L
1

I think is a email editor default options dependent. You telling to browser operation of open email editor then you can't say to it what method this email was send.

If you want have control with parameters like this you must implement sending mail by self.

Lebanon answered 2/7, 2010 at 13:2 Comment(0)
R
1

It will depend on the user's e-mail client setup.

If they've got "send e-mail in plain text" (or what ever the option is on their e-mail system) then the text will be interpreted as plain text.

If they got "send as HTML" then it should get encoded correctly.

You have no control over this.

Roter answered 2/7, 2010 at 13:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.