|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull Requests
Pull requests: HistoryAllCommentsChangesGit/SVN commits              [2020-01-05 14:19 UTC] cmb@php.net
 
-Status: Open
+Status: Verified
  [2020-01-05 14:19 UTC] cmb@php.net
  [2020-01-05 14:19 UTC] cmb@php.net
  [2020-01-06 13:51 UTC] cmb@php.net
  [2020-01-06 13:51 UTC] cmb@php.net
 
-Status: Verified
+Status: Closed
  [2020-01-06 13:53 UTC] cmb@php.net
 
-Assigned To:
+Assigned To: cmb
  [2020-01-07 13:16 UTC] anrdaemon at yandex dot ru
 | |||||||||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 03:00:01 2025 UTC | 
Description: ------------ Using the code sample below, you could see that it adds a "\r\n" to the end of the mail headers irrelevant to $additional_headers containing a meaningful value. Even using an empty($addParams) ? NULL/false : implode() replacement, it does not fix the problem. The resulting message will still start from second line. Which is bad for look. To beat it, you're forced to check for empty($addParams) before invoking mail() (and to have two separate mail() lines in your code, which does not lead to the code clarity)... Test script: --------------- <?php $addParams = array(); mail('someuser@example.com', 'testsubj', 'Body part', implode("\r\n", $addParams));