I am using PEAR Mail to send emails, and I found that if the "From:" field is something like From: Dragoş <[email protected]>
, PEAR returns an error:
Validation failed for: Dragoş <[email protected]>
But, if I remove the ş
, PEAR returns true and sends email.
I tried to search on Google and StackOverflow for valid characters, but seems I have no luck here. Does anyone know what are the valid characters for the display name in From field?
Also, is there any way to "encode" these chars to be allowed on this field? I use PHP.
Thank you!
Nuno
The display name is the name that appears on your outgoing emails. This is the name recipients will see when you email them.
The short answer is yes, email addresses can include these characters, but with some exceptions. The two biggest factors to consider are hyphen placement and email service provider.
In MIME you have to use only ASCII encoded characters.
In order to pass non-ASCII chars, you have to use Word encoding.
Copied from the linked article:
For example,
Subject: =?iso-8859-1?Q?=A1Hola,_se=F1or!?=
is interpreted as "Subject: ¡Hola, señor!".
The same can be applied to the "name" part (not the email) of the "From" and "To" MIME fields.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With