|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-05-13 18:27 UTC] kalle@php.net
-Status: Open
+Status: Feedback
[2010-05-13 18:27 UTC] kalle@php.net
[2010-05-14 12:46 UTC] juergen dot vollmer at informatik-vollmer dot de
[2010-05-14 13:40 UTC] johannes@php.net
-Status: Feedback
+Status: Closed
-Assigned To:
+Assigned To: johannes
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 06:00:01 2025 UTC |
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).