Page 1 of 1
send multiple emails
Posted: Fri Nov 11, 2005 1:30 pm
by alexmaster_2004
Hi There
i want to know how to send an email to multiple users at once.
Hope anyone can help
Thanks
Posted: Fri Nov 11, 2005 1:39 pm
by Luke
Code: Select all
function MAIL_NVLP($fromname, $fromaddress, $toname, $toaddress, $subject, $message){
// Copyright ? 2005 ECRIA LLC, http://www.ECRIA.com
// Please use or modify for any purpose but leave this notice unchanged.
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\n";
$headers .= "X-Priority: 3\n";
$headers .= "X-MSMail-Priority: Normal\n";
$headers .= "X-Mailer: php\n";
$headers .= "From: \"".$fromname."\" <".$fromaddress.">\n";
return mail($toaddress, $subject, $message, $headers);
}
$recipients = array("John Eaton" => "johneaton@nancy.com", "MArk Jones" => "flappiwap@johneaton.com", "FOOBAR" => "foo@bar.com");
foreach($recipients as $key => $val){
MAIL_NVLP("Your Name", "you@yourdomain.com", $key, $val, "Subject", "message");
}
Posted: Fri Nov 11, 2005 2:28 pm
by alexmaster_2004
Hi
Thanks for reply. but i think you miss understand me.
what i mean is i want to excute the mail function just one time.
mean that the "$toaddres" variable must contain all the emai addresses
and when i use this statement: mail($toaddress, $subject, $message, $headers)
then the email shoild go to all emails in the $toaddress.
i hope that this is clear for you.
Thanks again
Posted: Fri Nov 11, 2005 3:12 pm
by Burrito
comma separate the addresses.