NYCPHP Meetup

NYPHP.org

[nycphp-talk] punctuation in From: header

Kenneth Dombrowski kenneth at ylayali.net
Mon Feb 26 16:16:58 EST 2007


Hi Robyn, 

On 07-02-26 15:45 -0500, Robyn Overstreet wrote:
> 
> Using double quotes in PHP doesn't seem to make a difference, but
> quoting in the string itself *does* work for sending punctuation.
> However, the quotation marks show up in the From name field, which I'd
> like to avoid if possible.
> 

I'm pretty sure the quotes are required by the rfc (ex. from rfc2822): 

A.1.2. Different types of mailboxes

   This message includes multiple addresses in the destination fields
   and also uses several different forms of addresses.

        ----
        From: "Joe Q. Public" <john.q.public at example.com>
        To: Mary Smith <mary at x.test>, jdoe at example.org, Who? <one at y.test>
        Cc: <boss at nil.test>, "Giant; \"Big\" Box" <sysservices at example.net>
        Date: Tue, 1 Jul 2003 10:52:37 +0200
        Message-ID: <5678.21-Nov-1997 at example.com>

        Hi everyone.
        ----

   Note that the display names for Joe Q. Public and Giant; "Big" Box
   needed to be enclosed in double-quotes because the former contains
   the period and the latter contains both semicolon and double-quote
   characters (the double-quote characters appearing as quoted-pair
   construct).  Conversely, the display name for Who? could appear
   without them because the question mark is legal in an atom.  Notice
   also that jdoe at example.org and boss at nil.test have no display names
   associated with them at all, and jdoe at example.org uses the simpler
   address form without the angle brackets.





More information about the talk mailing list