|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-01-10 19:06 UTC] indrek dot kriisa at gmail dot com
Description: ------------ If I send mail with >1 custom header it will be not delivered or is with corrupted header (extra \r\n after last header). If only 1 header line or no header - everything works mail function gives no error No difference when using "\n" or "\r\n" Reproduce code: --------------- $customheaders = 'X-Priority: 1 (Highest)'. "\r\n"; $customheaders .= 'X-MSMail-Priority: Highest'. "\r\n"; send_mail($to, $subject, $message, $customheaders); Mail don't deliver: MIME-Version: 1.0 Content-Type: text/html; charset=ISO-8859-1; Content-Transfer-Encoding: 8bit X-Priority: 1 (Highest) X-MSMail-Priority: Highest Mail delivers: MIME-Version: 1.0 Content-Type: text/html; charset=ISO-8859-1; Content-Transfer-Encoding: 8bit X-MSMail-Priority: Highest Expected result: ---------------- delivered email with added headers Actual result: -------------- extra linebreak (\r\n) between custom headers or mail is not delivered PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 11:00:02 2025 UTC |
function send_mail($to, $subject, $message, $customheaders = '') { $headers = "MIME-Version: 1.0\r\n". "Content-Type: text/html; charset=ISO-8859-1;\r\n". "Content-Transfer-Encoding: 8bit\r\n". $customheaders; return mail($to, $subject, $message, $headers); }