What is the maximum length of a valid email address?

前端 未结 6 1798
暗喜
暗喜 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:14

    According to the below article:

    http://tools.ietf.org/html/rfc3696 (Page 6, Section 3)

    It's mentioned that:

    "There is a length limit on email addresses. That limit is a maximum of 64 characters (octets) in the "local part" (before the "@") and a maximum of 255 characters (octets) in the domain part (after the "@") for a total length of 320 characters. Systems that handle email should be prepared to process addresses which are that long, even though they are rarely encountered."

    So, the maximum total length for an email address is 320 characters ("local part": 64 + "@": 1 + "domain part": 255 which sums to 320)

提交回复
热议问题