What characters are allowed in an email address?

后端 未结 17 2499
天命终不由人
天命终不由人 2020-11-22 00:29

I\'m not asking about full email validation.

I just want to know what are allowed characters in user-name and server parts of email address

17条回答
  •  Happy的楠姐
    2020-11-22 01:03

    Wikipedia has a good article on this, and the official spec is here. From Wikipdia:

    The local-part of the e-mail address may use any of these ASCII characters:

    • Uppercase and lowercase English letters (a-z, A-Z)
    • Digits 0 to 9
    • Characters ! # $ % & ' * + - / = ? ^ _ ` { | } ~
    • Character . (dot, period, full stop) provided that it is not the first or last character, and provided also that it does not appear two or more times consecutively.

    Additionally, quoted-strings (ie: "John Doe"@example.com) are permitted, thus allowing characters that would otherwise be prohibited, however they do not appear in common practice. RFC 5321 also warns that "a host that expects to receive mail SHOULD avoid defining mailboxes where the Local-part requires (or uses) the Quoted-string form".

提交回复
热议问题