我一直试图弄清楚电子邮件地址的格式是否符合URI的定义,但是到目前为止我还没有找到明确的证实。希望有人可以在这里提供一些见解。谢谢。
可以,但要加上"mailto:"前缀。
一个URI的格式如下:
<scheme>:<scheme-specific-part>
这里的<scheme>
是"mailto",<scheme-specific-part>
是邮件地址。
例如:
mailto:max@provider.com
是一个有效的URI。
根据RFC 3986:
统一资源标识符(URI)是一个紧凑的字符序列,用于标识抽象或物理资源。
基本语法组件如RFC所定义:
The generic URI syntax consists of a hierarchical sequence of
components referred to as the scheme, authority, path, query, and
fragment.
URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
hier-part = "//" authority path-abempty
/ path-absolute
/ path-rootless
/ path-empty
所以,电子邮件地址不是URI。但是,mailto:you@server.com
是一个有效的URI。
仅有电子邮件地址 - foo@bar.com - 我会说不行。 电子邮件地址链接 - mailto:foo@bar.com - 我会说可以。
mailto
)才能有效。 - McDowell是的,当与“mailto”方案一起使用时,可以查看这里:http://www.ietf.org/rfc/rfc2396.txt
1.3. URI示例
以下示例说明了常见使用的URI。
mailto:mduerst@ifi.unizh.ch
-- 用于电子邮件地址的mailto方案
mailto
)才能有效。 - McDowellhttps://www.rfc-editor.org/rfc/rfc2368 https://www.rfc-editor.org/rfc/rfc1738
我认为,如果电子邮件地址中包含“mailto:”模式引用,则可以将其视为URI;否则不能。但由于它仅在HTML页面中可见,在大多数情况下,电子邮件地址本身不能被视为URI。
如果您之前没有查看过,请查看RFC3305文档。
URI方案名称的官方注册表由IANA在http://www.iana.org/assignments/uri-schemes.html上维护。
希望有所帮助, 卡洛斯。
mailto:
方案,电子邮件地址就不能被视为 URI 吗? - SarahofGaia