创建mailto超链接,该链接将在Outlook中以超链接形式打开 [英] create mailto hyperlink that will open in outlook with a hyperlink in the body

查看:1052
本文介绍了创建mailto超链接,该链接将在Outlook中以超链接形式打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是我的场景:

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

 < a href =mailto:someemail@test.com?subject = Email Subject& ; body =点击
< a href =%22http://www.google.com%22> Here< / a>转到google.com>点击此处打开
Outlook和与生成的电子邮件< / a>

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

 点击< a href =http://www.google.com>此处< / a>去google.com 

http://www.google.com 将会在电子邮件中点击,但锚标记也会显示出来,而且很丑陋。



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

解决方案

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


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



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?

解决方案

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

这篇关于创建mailto超链接,该链接将在Outlook中以超链接形式打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆