Are single quotes legal in the name part of an email address?

感情迁移 提交于 2019-12-30 00:28:13

问题


For example:

jon.o'conner@example.com ?


回答1:


Yes, jon.o'conner@example.com is a valid email address according to RFC 5322.

From the Email address article at wikipedia (Syntax section):

The local-part of the email 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 (e.g. John..Doe@example.com).

(The syntax is formally defined in RFC 5322 section 3.4.1 and RFC 5321.)




回答2:


Although the answer is correct according to RFC 5322 the practice of using the quote (') has holes. Since it is string delimiter, too many automation and integration services fail when this character is used.

You will note that professional mail services like GMail do not allow it.

Strongly suggest that you use the alternate quote (`) if you need it, but in practice it should be avoided.




回答3:


The format for email addresses is defined in RFC 5322; The local part (i.e. recipient) 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 (e.g. John..Doe@example.com).

From this, you can see that single quotes are valid for the recipient address



来源:https://stackoverflow.com/questions/4816424/are-single-quotes-legal-in-the-name-part-of-an-email-address

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!