RE: [PHP] Email to database
| From: | Jay Blanchard | Date: | Fri, 05 Sep 2003 12:15:22 +0000 |
| Subject: | RE: [PHP] Email to database | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-161749@lists.php.net to get a copy of this message | ||
[snip]
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>";
}
[/snip]
At first glance .... $to is undefined. When testing set
error_reporting(E_ALL); to catch these kinds of things. Is it possible
that you define $to as your e-mail address somewhere else and each time
the thing loops it sends you a copy?
Have a pleasant, productive and prosperous day.