PHP 4.0 Bug #5113: Mail() function doesn't accept multiple recipients.
| From: | bjarne dot ingelsson at enator dot se | Date: | Sun, 18 Jun 2000 22:09:56 +0000 |
| Subject: | PHP 4.0 Bug #5113: Mail() function doesn't accept multiple recipients. | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-21699@lists.php.net to get a copy of this message | ||
From: bjarne.ingelsson@enator.se
Operating system: Win2000
PHP version: 4.0 Release Candidate 2
PHP Bug Type: Misbehaving function
Bug description: Mail() function doesn't accept multiple recipients.
PHP Version 4.0.0.
When sending mail to more than one recipient (comma separated) all recipients are sent,comma
separated, in just one SMTP: "RCPT TO" message.
The mailserver responds with "553 Invalid Address Syntax" and the mail of course fails.
There should be only one recipient in a RCPT TO message.
So when sending to several, the correct way of doing this should be to send several RCPT TO messages
with one recipient in each.
Example:
$To = "someone@thecompany.com,anotherone@thecompany.com";
mail($To,$Subject,$Msg,$Headers);
The SMTP will look like this:
RCPT TO: someone@thecompany.com,anotherone@thecompany.com
and should look like this:
RCPT TO: someone@thecompany.com
RCTP TO: anotherone@thecompany.com
The problem doesn't exist in PHP3.0.16.
/Bjarne