I am having real problems with the following code snippet. If jmcoba1.txt has only 1 record, the from: works perfectly. If on the other hand it has more than 1 record (email address) it puts a return address from the ISP.
Can someone give any insight to this.
<?
$fp = fopen("jmcoba1.txt","r");
$subject=addslashes($subject);
//$message=$_POST['message'];
$message=addslashes($message);
$rec=0;
while(!feof($fp))
{ $ln = fgets($fp,1024);
list($fname,$lname,$email) = explode("|",$ln);
$sendmessage="Dear ".$fname."\r\n".$message."\r\nJM\r\n";
mail($email, $subject.$rec, $sendmessage,"From:johnmess@hotmail.com\nReply-to:johnmess@hotmail.com\nX-mailer:PHP/".phpversion());
mail("jmessam@portjam.com", $subject."*", $sendmessage,"From:jmessam@portjam.com");
$rec=$rec+1;
}
?>
Emails Sent <? echo $rec;?>