What is the maximum length of a valid email address?

前端 未结 6 1797
暗喜
暗喜 2020-11-22 12:24

What is the maximum length of a valid email address? Is it defined by any standard?

6条回答
  •  鱼传尺愫
    2020-11-22 13:17

    user

    The maximum total length of a user name is 64 characters.

    domain

    Maximum of 255 characters in the domain part (the one after the “@”)

    However, there is a restriction in RFC 2821 reading:

    The maximum total length of a reverse-path or forward-path is 256 characters, including the punctuation and element separators”. Since addresses that don’t fit in those fields are not normally useful, the upper limit on address lengths should normally be considered to be 256, but a path is defined as: Path = “<” [ A-d-l “:” ] Mailbox “>” The forward-path will contain at least a pair of angle brackets in addition to the Mailbox, which limits the email address to 254 characters.

提交回复
热议问题