create mailto hyperlink that will open in outlook with a hyperlink in the body
Asked Answered
S

1

12

Here's my scenario:

I'm trying to embed a hyperlink in the body of an email that will be generated using the mailto hyperlink. So I will have something like this:

<a href="mailto:[email protected]?subject=Email Subject&body=Click 
<a href=%22http://www.google.com%22>Here</a> to go to google.com">Click Here to open 
Outlook and with generated email</a>

The problem is, this scenario will open outlook but the email will actually appear as:

Click <a href="http://www.google.com">Here</a> to go to google.com

the http://www.google.com will be clickable in the email but the anchor tag will also show up and it is ugly.

I'm not sure if this is possible, but can I somehow create this hyperlink in a way that Outlook won't catch the URL address and automatically create the anchor tag around it?

Solferino answered 29/11, 2010 at 14:16 Comment(0)
P
16

You can't do this. See the specification for mailto: URIs, which says:

The special "body" indicates that the associated is the body of the message. The "body" field value is intended to contain the content for the first text/plain body part of the message. The "body" pseudo header field is primarily intended for the generation of short text messages for automatic processing (such as "subscribe" messages for mailing lists), not for general MIME bodies. Except for the encoding of characters based on UTF-8 and percent-encoding, no additional encoding (such as e.g., base64 or quoted-printable; see [RFC2045]) is used for the "body" field value. As a consequence, header fields related to message encoding (e.g., Content-Transfer-Encoding) in a 'mailto' URI are irrelevant and MUST be ignored. The "body" pseudo header field name has been registered with IANA for this special purpose (see Section 8.2).

Palisade answered 29/11, 2010 at 14:43 Comment(2)
Excellent david, please tell me how did you find the specification? When I google "html mailto specification" this one doesn't come upCumuliform
I searched for "rfc mailto:" and then picked the highest numbered one in the results (since it has undergone a number of revisions and I didn't want an old one that didn't define the extra headers). It has nothing to do with HTML though, so you including that keyword probably threw the results off.Palisade

© 2022 - 2024 — McMap. All rights reserved.