Is an e-mail address a URI?

后端 未结 3 809
陌清茗
陌清茗 2021-02-12 05:42

I\'ve tried to figure out whether the format of an e-mail address can be said to comply with the definition of a URI or not, but I\'ve found no explicit confirmation of this so

相关标签:
3条回答
  • 2021-02-12 06:04

    Yes, but with "mailto:" prefix.

    A URI has this form:

    <scheme>:<scheme-specific-part>
    

    The <scheme> is "mailto", the <scheme-specific-part> is the address.

    For example:

    mailto:max@provider.com
    

    is a valid URI.

    0 讨论(0)
  • 2021-02-12 06:09

    Per RFC 3986:

    A Uniform Resource Identifier (URI) is a compact sequence of characters that identifies an abstract or physical resource.

    The basic syntax components as defined by the 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
    

    So - an e-mail address is not a URI. However mailto:you@server.com is a valid URI.

    0 讨论(0)
  • 2021-02-12 06:19

    An e-mail address on it's own - foo@bar.com - I'd say no. A link to an e-mail address - mailto:foo@bar.com - I'd say yes.

    0 讨论(0)
提交回复
热议问题