#!/usr/local/php/bin/php -q
<?php
$subject ="test mail" ;
$message ="test" ;
if(file_exists("usermail.txt"))
{
$newfile = fopen("/home/ahmiq/usermail.txt", "r");
while(!feof($newfile))
{
$mailaddy = fgetss($newfile, 255);
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: imtiaz <imtiaz@yahoo.com>\r\n";
$headers .= "To: $mailaddy\r\n";
$headers .= "Reply-To: ahmiq\n";
$headers .= "X-Priority: 1\r\n";
$headers .= "X-MSMail-Priority: High\r\n";
$headers .= "X-Mailer: DreamZ";
//$mailaddy = fgetss($newfile, 255);
mail($mailaddy, $subject, $message, $headers );
}
fclose($newfile);
}
?>
Ok this is the whole story.But its not working. When i excute the script it send the mail to local user as it should but in file usermail.txt there are some yahoo and hotmail address too.But that adress get mail from shell user name like "root".
Any help appreciated