mac007 Posted April 26, 2009 Share Posted April 26, 2009 Hello, all: I am trying to get this script to work... I did get it to work at some point but then got my code shuffled and now cant get it back... Anyways, 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 <[email protected]>"; $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 } ?> Link to comment https://forums.phpfreaks.com/topic/155668-why-this-send-db-records-to-email-script-doesnt-work/ Share on other sites More sharing options...
mac007 Posted April 26, 2009 Author Share Posted April 26, 2009 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. after all I had ran it severasl times, it was working just fine, and then all of a sudden it didnt... 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! Link to comment https://forums.phpfreaks.com/topic/155668-why-this-send-db-records-to-email-script-doesnt-work/#findComment-819352 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.