inconsistent mail sending
| From: | Michael P. Carel | Date: | Fri, 15 Mar 2002 03:38:00 +0000 |
| Subject: | inconsistent mail sending | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-88616@lists.php.net to get a copy of this message | ||
What wrong with this code? It does'nt consistently send email with the
users in that table. Sometimes it duplicate sending to a certain users and
sometimes it doesnt.
Please help
$query=("Select * from $users_tablename where Group_Id='3' ");
$result = mysql_query($query);
if(!$result)error_message(sql_error());
while($query_data=mysql_fetch_array($result)){
$E_mail=$query_data[E_mail];
$Title=$query_data[Title];
$Nickname=$query_data[Nickname];
$mail_body = "Sir $Nickname, \n \n";
$subject="For Approval 8D no. $Dno";
if(mail($E_mai, $subject, $mail_body)){
print("Message Sent");
}else{
error_message("Failed to Notify Mr. $Title! Contact your Systems
Administrator immediately! ");
}
Regards,
Mike