Hi,
I dont know if this is the right way to do this, so please have a looksee
and tell me.
Its working perfectly well...but will I have problems if I try it on a large
email list or
will it hog resources....etc? ANY advice appreciated.

<?php
$hostt="localhost"; $userr="ryan"; $passs="pass"; $db="test";
$connected=mysql_connect ("$hostt", "$userr", "$passs") or die ('DB error: '
. mysql_error());
mysql_select_db ("$db");

$query = "SELECT * FROM testEmail";
$result = mysql_query($query) or die("Error: " . mysql_error());

if($result)
{
 while($row = mysql_fetch_row($result))
 { $the_email = $row[0];
 echo "Mailing: &nbsp; &nbsp; &nbsp; &nbsp; ".$the_email."<br>";
 $subject = "Test subject";
 $mailcontent = "blah blah blah blah blah";
 $mail_from="Ryan the great <[EMAIL PROTECTED]>";
 $headers="From: ".$mail_from."\n"."Return-Path:
".$mail_from."\n"."Reply-To: ".$mail_from."\n";
mail($the_email,$subject,$mailcontent,$headers); }
}else{echo "no result";}
?>

The reason I used mysql_fetch_row is I thought I might make it more
personalized a bit later...to greet each
person in my database by name.

Thanks,
-Ryan

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to