Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Server-side Scripting _ I'm telling you man, it was working!

Posted by: CodeKing Oct 30 2006, 05:43 PM

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[0];
while ($email = mysql_fetch_array($emails))//Get the rest of the emails, adding a comma
$to = ", ".$email[0];
$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:\r\nReply-To:"; //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 (
© Invision Power Services (