note 39788 added to function.mail
| From: | Dave at rn2 dot php dot net | Date: | Tue, 10 Feb 2004 17:11:23 +0000 |
| Subject: | note 39788 added to function.mail | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-64969@lists.php.net to get a copy of this message | ||
I am trying to loop through a mySQL table and send an email to each record with some of the
record's information. Sample (and abbreviated) code is:
<?php
while ($item=mysql_fetch_array($items)) {
list ($email,$name,$address) = $item;
mail ($email,"Your address","Dear $name, your address is
$address","From: Me <me@me.com>");
}
?>
This code is sending multiple emails to each recipient with each pass. Any thoughts as to why?
----
Manual Page -- http://www.php.net/manual/en/function.mail.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+39788
Delete -- http://master.php.net/manage/user-notes.php?action=delete+39788&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+39788&report=yes
Search -- http://master.php.net/manage/user-notes.php