Duplicate e-mails
| From: | Anthony Rodriguez | Date: | Tue, 05 Feb 2002 20:35:15 +0000 |
| Subject: | Duplicate e-mails | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-83631@lists.php.net to get a copy of this message | ||
The following php script sends two (2) e-mails to each addressee. Why?
<?php
$connection=mysql_connect("localhost","wagner","XXX") or die ("No connection!");
$db=mysql_select_db("sbwresearch",$connection) or die ("No database!");
$message=" Dear consumer,\n
The following are the online surveys ... etc.\n";
$qry_1="select * from con_inf";
$result_1=mysql_query($qry_1,$connection) or die ("No query # 1!");
while ($row_1=mysql_fetch_array($result_1, MYSQL_ASSOC))
{
$e_mail=$row_1["e_mail"];
mail("$e_mail",
"News from SBW Research",
"$message",
"From:SBW Research <mail@sbwresearch.com>\n");
};
mysql_free_result($result_1);
mysql_close($connection);
header ("location:done.htm");
exit;
?>
Anthony Rodriguez
(sbwi@bellatlantic.net)