note 118602 added to function.mail
| From: | jim at jimbrooking dot net | Date: | Wed, 06 Jan 2016 16:17:26 +0000 |
| Subject: | note 118602 added to function.mail | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-204605@lists.php.net to get a copy of this message | ||
I recently changed hosting companies and spent a day trying to see why an email script that had been
working for years failed on the new server.
The answer was that the old hosting company's email server accepted multiple "CC:"
lines in the additional headers string, and the new did not. Thus on the new server
...
$add_hdr .= "CC: " . $email1 . PHP_EOL;
$add_hdr .= "CC: " . $email2 . PHP_EOL;
...
did not work, but
...
$add_hdr .= "CC: " . $email1 . ", " . $email2 . PHP_EOL;
...
did work.
In both cases, PHP's mail() function returned no error, but until I placed both emails,
comma-separated, in the same line I was getting the following error:
550 Messages should have one or no Cc headers, not 2.
Hope this helps someone.
----
Server IP: 72.52.91.14
Probable Submitter: 75.189.138.168
----
Manual Page -- http://php.net/manual/en/function.mail.php
Edit -- https://master.php.net/note/edit/118602
Del: integrated -- https://master.php.net/note/delete/118602/integrated
Del: useless -- https://master.php.net/note/delete/118602/useless
Del: bad code -- https://master.php.net/note/delete/118602/bad+code
Del: spam -- https://master.php.net/note/delete/118602/spam
Del: non-english -- https://master.php.net/note/delete/118602/non-english
Del: in docs -- https://master.php.net/note/delete/118602/in+docs
Del: other reasons-- https://master.php.net/note/delete/118602
Reject -- https://master.php.net/note/reject/118602
Search -- https://master.php.net/manage/user-notes.php