Hi,
I have the following code, which I'm sure should work, but doesn't, can anyone see anything wrong with it? Its just meant to get email from a table, where is_confirmed=1 and then send a newsletter, to all the e-mail address's in the database.
function send_newsletter($date,$subject,$text) {
mysql_select_db("hkihotels");
$query="SELECT email FROM test_table WHERE is_confirmed='1'";
$result=mysql_query($query);
if (!$result) {
$feedback .= ' ERROR - No Registered Users ' . mysql_error();
return false;
} else {
$count=0;
while( $email = mysql_fetch_row($result));
{
mail ($email[0], $subject, $text, "From: newsletter@hkihotels.com");
$count++;
}
$feedback .= ' Successfully Sent Newsletter ';
return true;
}
}
If anyone can help, I'd greatly appreciate it.
Ben