I have a script that is supposed to send mail to a group of users in a "chapter" (each user has a field: chapter_id, which corresponds to the "chapter" they belong to). I don't know whether it's the server settings or what, but the mail does not send correctly.
here's the code:
In the log file, $recipient shows up, but I guess the mail() function isn't working. Another funny quirk to this is that when it runs, it goes to the "Page cannot be displayed" browser message and when I refresh, it's fine. Previously, it returned Apache's "Internal Server Error" page, but then I changed something (can't remember what, though) and stopped doing that...?
is my code flawed or is it the server settings? here's my phpinfo: phpinfo.php

here's the code:
Code:
$server_email_limit=1000;
$sql_email="SELECT id,email FROM members WHERE chapter_id='$chap_id' AND active='1' AND email!=''";
$result_email=@mysql_query($sql_email,$c) or die(mysql_error());
$i=0;
while ($emailer=mysql_fetch_array($result_email) && $i<$server_email_limit) {
$recipient=$emailer['email'];
mail($recipient,$subject,$msg,$mailheaders);
write_log($_SERVER['PHP_SELF'],"news emailed to user: $recipient",$c);
$i++;
}
is my code flawed or is it the server settings? here's my phpinfo: phpinfo.php
