Re: Help Sending Mail

From: Date: Tue, 11 Dec 2007 21:05:22 +0000
Subject: Re: Help Sending Mail
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-265713@lists.php.net to get a copy of this message
On Dec 11, 2007 12:20 PM, Richard Lynch <ceo@l-i-e.com> wrote: > PS > > GMail will not accept \r\n between header lines, only \n > > I dunno if RFC822 specifies which ending but I *do* know that this > breaks the current PEAR mimePart.php code. > > Editing the code to hack \r\n to just \n for the _CRLF constant works > for gmail, but may break other mail clients if \r\n is the RFC822 > correct newline. > > PPS > Is anybody else tired of this endless newline "war" between \n and \r\n?! > > Can we just shoot anybody who doesn't accept either as valid? > As far as RFC822 is concerned: 3.1.2. STRUCTURE OF HEADER FIELDS Once a field has been unfolded, it may be viewed as being com- posed of a field-name followed by a colon (":"), followed by a field-body, and terminated by a carriage-return/line-feed. The field-name must be composed of printable ASCII characters (i.e., characters that have values between 33. and 126., decimal, except colon). The field-body may be composed of any ASCII characters, except CR or LF. (While CR and/or LF may be present in the actual text, they are removed by the action of unfolding the field.) and later... 3.2. HEADER FIELD DEFINITIONS These rules show a field meta-syntax, without regard for the particular type or internal syntax. Their purpose is to permit detection of fields; also, they present to higher-level parsers an image of each field as fitting on one line. field = field-name ":" [ field-body ] CRLF (http://www.faqs.org/rfcs/rfc822.html) That said, I can't recall having problems with a simple \n, but I usually stick to \r\n for mail headers. Andrew

« previous php.general (#265713) next »