Email to a list of address in your database.
| From: | Marie Osypian | Date: | Sun, 19 Jan 2003 02:58:57 +0000 |
| Subject: | Email to a list of address in your database. | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-24945@lists.php.net to get a copy of this message | ||
Hi,
I have a list of email address in a mysql database and I would like to
create a link that when clicked pulls up your my mail program and mails to
everyone in the database.
<a href="mailto:ARRAY OF EMAIL ADDRESS">Mail to
everyone</a>
Here is my code:
<p><Br>
<? $userquery = "select * from users";
$myuserquery = mysql_query($userquery, $connection) or
die("Couldn't execute query.");
while($myresult = mysql_fetch_array($myuserquery)) {
$emailAddress = $myresult['emailAddress'];
$to[] = "$emailAddress";
} $maxTo = count($to);
for($count = 0; $count < $maxTo; $count++) {
$mailTo = $to[$count];
}
?>
<p><a href="mailto:<?=$mailTo;?>">mail To all my list</a>