Re: Problems sending to several recipients with mail() using WIN NT and Apache
| From: | Richard Lynch | Date: | Tue, 16 Jan 2001 02:55:32 +0000 |
| Subject: | Re: Problems sending to several recipients with mail() using WIN NT and Apache | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-34743@lists.php.net to get a copy of this message | ||
> I'm using Apache 1.3.14 on WIN NT, and can't send mail to more than one
> recipient using the PHP-mail command.
>
> I've checked php.ini, and everything seems to be fine...
>
> This is an example that won't work (but should have worked..?)
>
> mail("to@you.com, and@you.com","subject","content");
>
> This one however turns out fine:
>
> mail("to@you.com","subject","content");
>
> I have also tried to "manipulate" the header with "cc:", but no copy
> arrives, only the one in the "to:" field.
The To: parameter technically is only required to accept one (1) email.
Many mail programs will accept multiple recipients there and DWIM and Cc:
them. Your mail program is apparently not one of those.
The Cc: thing with the extra headers should work on all compliant mail
servers...
$headers = "Cc: and@you.com\r\n";
$headers .= "From: trond.straume@online.no\r\n";
$headers .= "Reply-to: trond.straume@online.no\r\n";
mail("to@you.com", "subject", "content", $headers);
Note that \r\n is spec, but many mail programs also accept \n only and DWIM.
I'm guessing yours doesn't and that's what messed you up...