Pergunta

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:someemail@test.com?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?

Foi útil?

Solução

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top