+1 vote

I created a Mailbox object with specified friendly display name email address and received syntax error. According to RFC 822, display name is allowed and ignored. How do I include friendly display name using Mailbox object?

A.1.1. Alfred Neuman <Neuman@BBN-TENEXA>
A.1.2. Neuman@BBN-TENEXA

         These two "Alfred Neuman" examples have identical  seman-
    tics, as far as the operation of the local host's mail sending
    (distribution) program (also sometimes  called  its  "mailer")
    and  the remote host's mail protocol server are concerned.  In
    the first example, the  "Alfred  Neuman"  is  ignored  by  the
    mailer,  as "Neuman@BBN-TENEXA" completely specifies the reci-
    pient.  The second example contains  no  superfluous  informa-
    tion,  and,  again,  "Neuman@BBN-TENEXA" is the intended reci-
    pient.
by

1 Answer

0 votes

You just need to use MailBox constructor overload that takes both: display name and email address as parameters:

var m = new MailBox( "alice@mail.com" , "Alice");
by (297k points)
...