Hi
I am using a PHP / MySQL combination to send an email to all users in a
table.
When I run the script, say address1 in the resultset is [EMAIL PROTECTED],
address2 is [EMAIL PROTECTED] & address3 is [EMAIL PROTECTED] � When I run
the script, mail is sent to address1,address2 & address3. Problem is I get
copies of all mails sent to the first address pulled from the table.
Any help appreciated.
Thanks
Enda
--
=============================================
PHP Code
=============================================
$result1=mysql_query("select DISTINCT first_name,last_name,email_address
from <database> WHERE 1 ORDER BY id",$link);
//---------------------------------------------------------------------
while($row = mysql_fetch_array($result1))
{
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: Website <emailaddress>\r\n";
$headers .= "To: $row[email_address]\r\n";
$headers .= "X-Priority: 1\r\n";
$headers .= "X-MSMail-Priority: Normal\r\n";
$headers .= "X-Mailer: MyWebsite";
$subject = "$subject";
$message = "<html><head><title>aaa</title></head><body
bgcolor=ffffff>aaa</body></html>";
mail($to, $subject, $message, $headers)
or print "Could not send mail to customer";
print "<br><font size=1><font color=cccccc>mail sent to
</font><b>$row[email_address]</b>";
}
- + - + - + - + - + - + - + - + - + - + - + - + -
Enda Nagle
+353 86 168 0774
[EMAIL PROTECTED]
www.nightsol.net
- + - + - + - + - + - + - + - + - + - + - + - + -