This is part of my code. The mail() bit does not work as it should all the headers are in the mail body. i have a another mail() at the end of the script, that works fine, but it is not in a loop.
$count=0;
$adresse=array();
$fcontents = file ("adresses/".$tolist."");
while (list ($line_num, $addr) = each ($fcontents)) {
$adresse[$count] = $addr;
$count++;
}
for ($f=0;$f<=sizeof($adresse)-1;$f++){
set_time_limit(60);
mail($adresse[$f],$subject,$message,"From: $sender\nX-Sender: $sender\nContent-Type: text/html;charset=iso-8859-1\nReply-To: $fake_from\nX-Priority: $priority\nReturn-Path: $real_email\nErrors-To: $real_mail\nX-Mailer: PHP");
}