Bug #51810 [Fbk->Csd]: empty line added if $header is given to mail()
Edit report at http://bugs.php.net/bug.php?id=51810&edit=1
ID: 51810
Updated by: johannes@php.net
Reported by: juergen dot vollmer at informatik-vollmer dot de
Summary: empty line added if $header is given to mail()
-Status: Feedback
+Status: Closed
Type: Bug
Package: Mail related
Operating System: Linux / SuSE 11.2 and 10.2
PHP Version: 5.3.2
-Assigned To:
+Assigned To: johannes
Previous Comments:
------------------------------------------------------------------------
[2010-05-14 12:46:25] juergen dot vollmer at informatik-vollmer dot de
That version of php fixes the problem
Thanks
Jürgen
------------------------------------------------------------------------
[2010-05-13 18:27:54] kalle@php.net
Please try using this snapshot:
http://snaps.php.net/php5.3-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
------------------------------------------------------------------------
[2010-05-13 16:58:13] juergen dot vollmer at informatik-vollmer dot de
Description:
------------
If mail() is called with the $header argument, an empty line is inserted
before the $header ĺine. Therefore the content of $header is not seen
as valid mail header.
Test script:
---------------
<?php
$crlf = chr(13) . chr(10);
$to = "me@example.com";
$subject = "my subject";
$body1 = "my body -- with header";
$body2 = "my body -- no header";
$header = "From: you@example.com${crlf}".
"X-Mailer: PHP/" . phpversion() . $crlf;
$res1 = mail ($to, $subject, $body1, $header);
$res2 = mail ($to, $subject, $body2);
printf ("mail res=${res1}; ${res2}\n");
?>
Actual result:
--------------
If $header is given (see example above) the (shortened) mail text looks
like:
--------------------------- from here
Return-Path: <....>
Received: ....
To: me@example.com
Subject: my sub
X-Mailer: PHP/5.3.1
Message-Id: <...>
From: ...
Message-Id: <...>
Date: ...
X-Length: 2014
X-UID: 252148
Message-Id: <...>
Date: ....
From: ....
my body -- with header1
---------------------- to here
Now After X-UID: there is an empty line, which should n ot be there (in
my opinion).
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=51810&edit=1
Thread (4 messages)