Hello, all:

I am trying to get this script to work... What I'm trying to do is to be able to email back customers whose emails I have saved on in my database. So pretty much the emails get sent as it runs the "while" loop. Somehow it doesnt seem to be doing it though...

What am I missing??

Thanks!

<?php

$connection = mysql_pconnect('hostserver','user','password') or die('Connection not found!');   
$db = mysql_select_db('database', $connection) or die('Database not found!'); 


$emails = mysql_query("SELECT DISTINCT offer_email FROM customer_emails ORDER BY dateEntry DESC");

while ($row_emails = mysql_fetch_array($emails))
{

$to = $row_emails['offer_email'];
$subject = "Website Info";
$message = "hello message\n\n";
$from = "From: Website <info@myweb.com>";
$header = "MIME-Version: 1.0\r\n";
$header .= "Content-type: text/html; charset=iso-8859-1\r\n";
$header .= $from; // set the from field in the header
$header .= "\n"; // add a line feed
mail($to, $subject, $message, $header); // send the e-mail
}


?>

hello, all:

well, I guess the script DOES work!! I placed the code in another site, ran it from there, and ditto.. it worked just fine. I guess must be that my email host-server might have been stopping my testing cause it might have been seen as SPAM?? is that possible?

Thanks!

This question has already been answered. Start a new discussion instead.