Html 创建将在 Outlook 中打开且正文中带有超链接的 mailto 超链接
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4304581/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
create mailto hyperlink that will open in outlook with a hyperlink in the body
提问by Ben
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:[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:
问题是,这种情况会打开 Outlook,但电子邮件实际上会显示为:
Click <a href="http://www.google.com">Here</a> to go to google.com
the http://www.google.comwill 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 地址并自动在其周围创建锚标记?
回答by Quentin
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”表示关联的是消息的正文。“body”字段值旨在包含消息的第一个文本/纯正文部分的内容. “body”伪头域主要用于生成自动处理的短文本消息(例如邮件列表的“订阅”消息),而不是用于一般的 MIME 正文。除了基于 UTF-8 和百分比编码的字符编码之外,没有其他编码(例如 base64 或 Quote-printable;参见 [RFC2045])用于“body”字段值。因此,“mailto”URI 中与消息编码(例如,Content-Transfer-Encoding)相关的头字段是不相关的,必须被忽略。“body”伪标头字段名称已为此特殊目的向 IANA 注册(参见第 8.2 节)。