|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55216 Bug in PHPmail
Submitted: 2011-07-15 15:49 UTC Modified: 2011-07-18 22:29 UTC
From: seinghhaccoski at rocketmail dot com Assigned:
Status: Not a bug Package: Mail related
PHP Version: 5.2.17 OS: Debian
Private report: No CVE-ID: None
 [2011-07-15 15:49 UTC] seinghhaccoski at rocketmail dot com
Email that shows headers 

Test script:
//some $_POST['email'] validations 
$to = $_POST['email'];
$subject = 'Ordinazione';
$headers = 'From:' . "\r\n";
$headers .=    'Reply-To:' . "\r\n" .
'X-Mailer: PHP/' . phpversion(). "\r\n".
"MIME-Version: 1.0\r\n".
"Content-Type: text/html; charset=\"iso-8859-1\"\r\n".
"Content-Transfer-Encoding: 7bit\n\n";
mail($to, $subject, $messaggio, $headers);

Expected result:
I want the email headers to don't appear in the email content

Actual result:
A mail with the headers in the content:

X-Mailer: PHP/5.2.6-1+lenny9

MIME-Version: 1.0

Content-Type: text/html; charset="iso-8859-1"

Content-Transfer-Encoding: 7bit
Message-Id: <>
Date: Fri, 15 Jul 2011 21:23:26 +0200 (CEST)
La sua ordinazione &egrave; stata completata con successo. <br>Totale: 100


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-07-18 22:29 UTC]
-Status: Open +Status: Bogus
 [2011-07-18 22:29 UTC]
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

As documented on the mail() manual page, your MTA is (a bad) one that expects only 
\n to separate headers, not \r\n.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Dec 06 15:01:27 2023 UTC