Email headers: Allowed/disallowed characters in FROM header: (display) name

909 Views Asked by At

I'm trying to find an answer to the question about which characters is allowed (or disallowed) in the FROM header (display) name..

"My Display Name" <[email protected]>

I'm talking about the My Display Name in quotations.

I've looked at tools.ietf.org/html/rfc822 and tools.ietf.org/html/rfc2822 but can't seem to find anything specifying these requirements. Perhaps because it accepts all unicode/UTF-8 characters but it doesn't state that either.

Any help or reference to some documentation would be greatly appreciated.

2

There are 2 best solutions below

2
JGNI On

Email header fields, of which From is one, can only contain ASCII characters. See Section 3.1.1 of RFC 822. However, RFC 1342 gives a mechanism to work around this limitation.

0
Miguel On

Characters that have values between 33 and 126, inclusive, except colon.

So if your "customer" has this name "Clinic: X" this will be blocked by most email client providers. You can "replace the ":" with " " in that case for example.

See https://tools.ietf.org/html/rfc5322#section-2.2

According to Section 2.2 of RFC 5322 : "A field name MUST be composed of printable US-ASCII characters (i.e., characters that have values between 33 and 126, inclusive), except colon. A field body may be composed of printable US-ASCII characters as well as the space (SP, ASCII value 32) and horizontal tab (HTAB, ASCII value 9) characters (together known as the white space characters)