RE: [PHP] MySQL email function
| From: | Jon Haworth | Date: | Thu, 25 Jan 2001 15:53:55 +0000 |
| Subject: | RE: [PHP] MySQL email function | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-36636@lists.php.net to get a copy of this message | ||
Something like this (OTOH so may need some tweaking but should be generally
ok):
<?php
$counter = 0;
$starttime = time();
$subject = "Spam!";
$message = "This is a genuine money-making opportunity.\n";
$message .= "blah blah blah blah\n";
$query = mysql_query("SELECT * FROM TheNameOfTheTableFullOfEmailAddresses",
$db);
if ($result = mysql_fetch_array($query)) {
do {
$counter++;
$mailto = $result["EmailAddressField"];
mail ("$mailto", "$subject", "$message");
} while ($result = mysql_fetch_array($query));
$endtime = time();
$timetaken = $endtime - $starttime;
?>
<p><b>Done!</b></p>
<p><?php echo $counter; ?> e-mails sent in <?php echo $timetaken; ?>
seconds.</p>
<?php
}
?>
HTH
Jon
-----Original Message-----
From: Kenneth R Zink II [mailto:Hellcat1@EV1.Net]
Sent: 25 January 2001 15:28
To: PHP
Subject: [PHP] MySQL email function
How would I go about pulling e-mail addresses from a database and sending
and e-mail using that list?
Kenneth R Zink II Hellcat1@S-Series.Org ICQ# 5095094
'87 2.8L TBI GMC S-15 Ext. Cab (Hurricane) ...524 in the works !!!
http://www.s-series.org/htm/windstorm/project-windstorm.htm
'85 3.4L Carbed Chevy S-10 Blazer (FireStorm) ...Soon to be 3.4L SFI DIS !!!
http://www.s-series.org/htm/firestorm/firestorm.htm
Racing by the Grace of God!!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net