I created this PHP script to get every email on a MySQL db and email a newsletter to them. It was working, but I did something and now it doesn't. Help!
$emails = mysql_query("SELECT * FROM `newsletter`"); //Get emails
$email = mysql_fetch_array($emails); //Get one email
$to = $email;
while ($email = mysql_fetch_array($emails))//Get the rest of the emails, adding a comma
$to = ", ".$email;
$to = "******@********.***"; //Just temporarely for testing
$subject = "Clock Tower Gifts Newsletter"; //Set the subject
$message = $hiddentext; //Get $hiddentext (The message) to transfers it's data to $message (Just for organization)
$headers = "From: firstname.lastname@example.org\r\nReply-To: email@example.com"; //Set the headers
if ($textarea==0) //Is it an HTML message?
$headers .= "\r\nMIME-Version: 1.0\r\nContent-Type: text/html; charset=iso-8859-1\r\n"; //If it is, set some additional headers
mail ($to,$subject,$message,$headers); //Send the message!
Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)