I am having a problem.... but I am not QUIET sure if it is the server or my code.... I am leaning twords the code as there are 3 seperate email functions and 2 are working with no problems.
Anyway, here is what I am using to send:
case "sendmail":
$id=stripslashes($_POST['id']);
$msg=stripslashes($_POST['S1']);
$sub=stripslashes($_POST['subject']);
$msg=str_replace("\n","<br>",$msg);
//if (strtolower($id) == "all")
// {
$sql="select * from `".$ext."_members`";
$res=mysql_query($sql);
$hhh="From: $adName <$adEmail>\nX-Mailer: php (".$_SERVER['REMOTE_ADDR'].")\nContent-Type: text/html;";
while($data=mysql_fetch_array($res))
{
$message=str_replace("{name}",$data[member],$msg);
$subject=str_replace("{name}",$data[member],$sub);
if (isset($data[email]))
{
mail($data[email],"$subject","$message",$hhh);
}
}
/*else{
$sql="select * from `".$ext."_members` where member='$id'";
$res=mysql_query($sql);$data=mysql_fetch_array($res);
if ($test=mysql_num_rows($res)==0){ echo"member doesnt exist!"; exit;}
$msg=str_replace("{name}",$data[member],$msg);
$sub=str_replace("{name}",$data[member],$sub);
$hhh="From: $adName <$adEmail>\nX-Mailer: php (".$_SERVER['REMOTE_ADDR'].")\nContent-Type: text/html;";
if (isset($data[email]))
{
$res=mail($data[email],"$sub","$msg",$hhh);
if (!$res){echo"not sent!"; }
}
else echo"Invaild email ".$data[email];
}*/
THAT SENDS OK................
But this is hit and miss... maybe 2 out of 20 have actaully went through
$url="http://".$SERVER[HTTP_HOST].$SERVER[PHP_SELF]."?teacher=$ext";
$url=str_replace("main.php","students.php",$url);
$hhh="From: $adName <$adEmail>\nX-Mailer: php (".$_SERVER['REMOTE_ADDR'].")\nContent-Type: text/html;";
while($data=mysql_fetch_array($res))
{
$message="Dear $data[member]:<br><br>
$adName has made an update to the school page.<br>
Click on the link below to login and see the changes:<br>
<a href=$url>$url</a><br><br><br>
";
if (isset($data[email]))
{
mail($data[email],"Page is updated","$message",$hhh);
}
// if ()
}