The below given was supposed to send emails to subscribers but the mail is not being delivered.
Please help.
But these mail are not being delivered to my email. Please what could be the cause
Please help.
Code:
$allemails="select email from members";
//mysql_select_db($database_dbCon, $dbCon);
mysql_select_db($database,$db_connect) or die( "Unable to select database");
$Result = mysql_query($allemails, $db_connect) or die(mysql_error());
// $str="";
while($row=mysql_fetch_array($Result)){
$to=$row[0];
$sender="<gospel@domain.com>";
// Your subject
$subject="Gospel Alert from domain.com";
// From
$header="from: Gospel Alart <news@domain.com>";
// Your message
$messages= "Your daily news alert has returned the following alert for you today\r\n";
//$messages= "<a href=http://alart1.php</a><br>";
// send email
$sentmail = mail($to,$subject,$messages,$header);
//$str.="-".$sentmail;
if($sentmail)
echo("Mail sent to ".$row[0]." successfully<br/>");
else
echo("Mail not delivered to ".$row[0]." successfully<br/>");
}
Comment