Re: Email to a list of address in your database.
| From: | Adam Royle | Date: | Sun, 19 Jan 2003 22:11:56 +0000 |
| Subject: | Re: Email to a list of address in your database. | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-24955@lists.php.net to get a copy of this message | ||
This should work. You were on the right track, although you might want to
use better var names so you don't get confused. You can see I have changed
them to what I would normally use.
Adam
<?php
$sql = "select * from users";
$result = mysql_query($sql, $connection) or die("Couldn't execute
query.");
while($row = mysql_fetch_array($result)) {
$to[] = $row['emailAddress'];
}
$mailTo = implode(";",$to);
?>
<p><a href="mailto:<?= $mailTo ?>">mail To
all my list</a></p>