Legal email address gets bounced back

Viewed 405

Platform: Outlook O365
OS: Win 10
Exchange Server in the backend
Cached Mode: On

The email is in the following format (single quotes included)
'First Last (Home)' <client@domain.com>

The bounce back message reads

The format of the email address isn't correct. A correct address looks like this: someone@example.com. Please check the recipient's email address and try to resend the message.

Remote Server returned '550 5.1.3 STOREDRV.Submit; invalid recipient address'

NOTE: The code below does not throw an exception even though single quotes are used instead of the double quotes mentioned in RFC 5322

using System;

namespace mailVerify
{
    class Program
    {
        static void Main(string[] args)
        {
            string email = "'first last (Home)' <yourname@domain.com>";

            try
            {
                var addr = new System.Net.Mail.MailAddress(email);

                Console.WriteLine(addr);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
    }
}
1 Answers

According to RFC 5322 the name in front of the angle-address must be delimited by double quotes. Apparently the use of single quotes there is not allowed by the standard.

The error message is incomplete since it ignores the name that can appear before the address.

Related