Multiple recipients with mail();
| From: | Davy Obdam | Date: | Tue, 03 Sep 2002 00:26:30 +0000 |
| Subject: | Multiple recipients with mail(); | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-15642@lists.php.net to get a copy of this message | ||
Hi
I have this piece of script on my site. It sends e-mail from the
feedbackform. I can only send e-mail to one recipient, but i would like
to send this e-mail to multiple recipients. Here is my code, i hope
someone can help me out. Thanks already!
//Send e-mail from feedbackform
//recipients
$recipients="me@somedomain.com";
//Subject
$subject="Reaction from website";
//Message
$message="Reaction from website:\n\nName: $name\nAdres: $adres\nZipCode:
$zip\nCity: $city\nPhone: $phone \nEmail:
$email\n\nComments:\n\n$comments\n";
//headers
$headers="From:$name <$email>\n";
//verstuur de e-mail
$result= mail($recipients,$subject,$message,$headers);
//Controleer of e-mail verstuur is
if(!$result)
{
//Sending has failed
echo "Sending your e-mail has failed<br><br>";
echo "<a href=javascript:history.go(-1)>Back</a>\n";
} else {
//Send succesfully
echo "<b>Your e-mail is send</b><br>\n";
echo "Thanks for your time<br><br>";
echo "<a href=index.php>Back</a>\n";
}
Thanks:-)
Greetings
Davy Obdam
mailto:info@davyobdam.com
url: http:///www.davyobdam.com