Forum Moderators: coopster

Message Too Old, No Replies

Newsletter

sending email to subscribers

         

dbarasuk

10:01 pm on Dec 16, 2007 (gmt 0)

10+ Year Member



hello!
Suppose you have a list of subscribers' emails in you mysql database.

How can you write a loop function that would send a newsletter to all the emails contained therein?

barns101

10:20 pm on Dec 16, 2007 (gmt 0)

10+ Year Member



Not practical for sending lots of emails, but this works:

// Connect to database before this
$query = mysql_query("SELECT * FROM `your_table`");
while($row = mysql_fetch_array($query))
{
// Use mail() and the $row array from your database query (e.g. $row[field1] etc...)
}