note 118602 deleted from function.mail by crell

From: Date: Tue, 12 Apr 2022 01:10:34 +0000
Subject: note 118602 deleted from function.mail by crell
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-218240@lists.php.net to get a copy of this message
Note Submitter: jim at jimbrooking dot net ---- 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.

« previous php.notes (#218240) next »