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

36,011

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).

Share:
36,011

Related videos on Youtube

Ben
Author by

Ben

Updated on July 09, 2022

Comments

  • Ben
    Ben almost 2 years

    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?

  • m.edmondson
    m.edmondson over 13 years
    Excellent david, please tell me how did you find the specification? When I google "html mailto specification" this one doesn't come up
  • Quentin
    Quentin over 13 years
    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.