Hi There
i want to know how to send an email to multiple users at once.
Hope anyone can help
Thanks
send multiple emails
Moderator: General Moderators
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");
}-
alexmaster_2004
- Forum Commoner
- Posts: 35
- Joined: Wed Sep 14, 2005 8:44 am
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
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