创建mailto超链接,该超链接将在Outlook中打开,并在主体中显示超链接

时间:2022-11-15 09:48:54

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:

我正在尝试在使用mailto超链接生成的电子邮件正文中嵌入超链接。所以我会有这样的事情:

<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:

问题是,这种情况会打开Outlook,但电子邮件实际上会显示为:

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.

http://www.google.com将可以在电子邮件中点击,但锚标记也会显示,而且很难看。

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?

我不确定这是否可行,但是我可以以某种方式创建此超链接,以便Outlook不会捕获URL地址并自动在其周围创建锚标记吗?

1 个解决方案

#1


16  

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

你不能这样做。请参阅mailto:URIs的规范,其中说:

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

特殊的“正文”表示关联的是消息的正文。 “body”字段值旨在包含消息的第一个text / plain正文部分的内容。 “body”伪头字段主要用于生成用于自动处理的短文本消息(例如邮件列表的“订阅”消息),而不是用于一般MIME主体。除了基于UTF-8和百分比编码的字符编码之外,没有其他编码(例如,base64或quoted-printable;参见[RFC2045])用于“body”字段值。结果,与'mailto'URI中的消息编码(例如,内容传输编码)相关的头字段是无关紧要的并且必须被忽略。出于此特殊目的,已在IANA注册了“body”伪标头字段名称(请参阅第8.2节)。

#1


16  

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

你不能这样做。请参阅mailto:URIs的规范,其中说:

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

特殊的“正文”表示关联的是消息的正文。 “body”字段值旨在包含消息的第一个text / plain正文部分的内容。 “body”伪头字段主要用于生成用于自动处理的短文本消息(例如邮件列表的“订阅”消息),而不是用于一般MIME主体。除了基于UTF-8和百分比编码的字符编码之外,没有其他编码(例如,base64或quoted-printable;参见[RFC2045])用于“body”字段值。结果,与'mailto'URI中的消息编码(例如,内容传输编码)相关的头字段是无关紧要的并且必须被忽略。出于此特殊目的,已在IANA注册了“body”伪标头字段名称(请参阅第8.2节)。