Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

bulk mail not sending

Status
Not open for further replies.

phpgramma

Programmer
Dec 24, 2004
35
0
0
US
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:
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++;
}
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

 
I always wind up doing this. I fixed it- very simple. The script was fine, I was just not correctly declaring a variable.... rrr.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top