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.


    $sql = "select * from users";
    $result = mysql_query($sql, $connection) or die("Couldn't execute

    while($row = mysql_fetch_array($result)) {
         $to[] = $row['emailAddress'];

    $mailTo = implode(";",$to);
<p><a href="mailto:<?= $mailTo ?>">mail To all my list</a></p>

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to