ID:               20340
 User updated by:  [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
 Status:           Open
 Bug Type:         Mail related
 Operating System: Windows XP SP1
 PHP Version:      4CVS-2002-11-10
 New Comment:

the bug system seems to have entered an erroneous carriage return on
line 7 of my example code.


Previous Comments:
------------------------------------------------------------------------

[2002-11-10 11:04:58] [EMAIL PROTECTED]

tested on 4.3pre2 and 4.3-snapshot (2002-11-10).

php4/win32/sendmail.c contains:

/* This pattern removes \r\n from the start of the string,
 * \r\n from the end of the string and also makes sure every line
 * is only wrapped with a single \r\n (thus reduces multiple
 * occurences of \r\n between lines to a single \r\n) */
#define PHP_WIN32_MAIL_RMVDBL_PATTERN   "/^\r\n|(\r\n)+$/m"
#define PHP_WIN32_MAIL_RMVDBL_REPLACE   ""

i'm not certain if the applicable specification(s) require that there
be NO multiple occurences of \r\n in a mime message, but this addition
has broken compatibility with outlook express clients at the very
least, which seems to depend on multiple \r\n to separate content
blocks.

it will also unecessarily alter valid mail content, and therefore i
believe \r\n should only be stripped from the beginning and end of the
message, if at all.

example code:

--cut--
$headers  = 'From: [EMAIL PROTECTED]' . "\r\n";
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-Type: multipart/mixed;' . "\r\n";
$headers .= '   boundary="703c1875a9605c5619dd34f7642dcad8"' . "\r\n";
$headers .= 'Content-Transfer-Encoding: 7bit' . "\r\n\r\n";

$headers .= 'This is a multi-part message in MIME format.' .
"\r\n\r\n";

$headers .= '--703c1875a9605c5619dd34f7642dcad8' . "\r\n";
$headers .= 'Content-Type: text/html;' . "\r\n";
$headers .= '   charset="iso-8859-1"' . "\r\n";
$headers .= 'Content-Transfer-Encoding: 7bit' . "\r\n\r\n";

$headers .= '<pre>' . "\r\n";
$headers .= 'test paragraph 1' . "\r\n\r\n";

$headers .= 'test paragraph 2' . "\r\n";
$headers .= '</pre>' . "\r\n\r\n";

$headers .= '--703c1875a9605c5619dd34f7642dcad8--' . "\r\n";

mail('[EMAIL PROTECTED]', 'test', null, $headers);
--cut--

the above code will deliver a seemingly empty email. if the message
source is viewed, you will find that even had the content been
displayed, it would not be as the sender had intended (no blank line
between paragraphs):

--cut--
Content-Transfer-Encoding: 7bit
<pre>
test paragraph 1
test paragraph 2
</pre>
--703c1875a9605c5619dd34f7642dcad8--
--cut--


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=20340&edit=1

Reply via email to