“MailTo” ...在收件人上设置一个正确的名字 [英] The "MailTo" ...setting a proper name on the Recipient

查看:233
本文介绍了“MailTo” ...在收件人上设置一个正确的名字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



类似于:

$ b

如何在HTML中设置收件人的专用名称
$ b

  mailto:John Wayne(jw@email.com)?subject .. 

我怎么做到这一点??

code> mailto:链接, RFC 1738 ,说这个:


一个mailto网址的形式如下:

  mailto:< rfc822-addr-spec> 

其中 < rfc822-addr-spec> 是在RFC 822中指定的
[ addr-spec a href =http://tools.ietf.org/html/rfc1738 =noreferrer> 6 ]。

在该定义下,不能包含专有名称。



但RFC的 mailto:部分1738被 RFC 2368 ,它允许(除其他外,包括预定义的主题行) RFC 822 邮箱规范 - 其中包含专有名称。



[2016-05-31] DavidBalažic在评论中指出,RFC 2368反过来被 RFC 6068 。从第9部分,RFC 2368的主要变化:


主要变化来自 RFC 2368 如下:


在实际使用中, mailto:Fred Foo< foo@example.com> ; 似乎仍然有效,但没有官方支持;您可能还必须对空间进行编码,即 mailto:Fred%20Foo< foo@example.com> ,和/或将名称在引号中, mailto:Fred Foo< foo@example.com>


How do I set a proper name for the recipient when in HTML I want to use the "mailto" tag.

Something like:

mailto:"John Wayne(jw@email.com)?subject..

How do I achieve that ??

解决方案

The original standard for mailto: links, RFC 1738, says this:

A mailto URL takes the form:

mailto:<rfc822-addr-spec>

where <rfc822-addr-spec> is (the encoding of an) addr-spec, as specified in RFC 822 [6].

Under that definition, no proper name could be included.

But the mailto: section of RFC 1738 has been superseded by RFC 2368, which allows (among other things, including predefined subject lines) for an RFC 822 mailbox specification—which includes a proper name.

[2016-05-31] As David Balažic points out in a comment, RFC 2368 is in turn obsoleted by RFC 6068. From Section 9, "Main Changes from RFC 2368":

The main changes from RFC 2368 are as follows:

In actual use, mailto:Fred Foo<foo@example.com> still seems to work, but it’s not officially supported; you may also have to encode the space, i.e., mailto:Fred%20Foo<foo@example.com>, and/or put the name in quotes, i.e., mailto:"Fred Foo"<foo@example.com>.

这篇关于“MailTo” ...在收件人上设置一个正确的名字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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