[PHP] Loop though email list

2001-08-14 Thread Erich Kolb
I am a total newbie, so please forgive the simplicity! I have a huge list of email addresses in a text file and also in a MySQL DB that I would like to use PHP to loop through and send an email to each one of them. How do I loop through a text file using each email in the txt file as a seperate

Re: [PHP] Loop though email list

2001-08-14 Thread Tyler Longren
With mysql: $connection = mysql_connect(host,user,pass); $db = mysql_select_db(db_to_use, $connection); $sql = mysql_query(SELECT * FROM table ORDER BY email ASC); while ($row = mysql_fetch_array($sql)) { $email = $row[email]; $name = $row[name];

Re: [PHP] Loop though email list

2001-08-14 Thread Daniel Adams
for a file i would do something like this: ? $file = file (addressfile.txt); foreach ($file as $address) mail ($address, subject, message, From: [EMAIL PROTECTED]); ? for the mysql db it would be something like this (this is probably a little off): ? $mysql = mysql_pconnect ($server,