I'm using this simple script to detect website content change and mail if there is a change.I've set a cron job to run the script everyday and it's working fine but when script detects a change it sends blank email without body.Why thi is happening?Am I doing something wrong here(in the mail part)?
<?php
$contents = file_get_contents('http://izoneknr.com');
$hash = file_get_contents('../heimdall/heimdall.txt');
if ($hash == ($pageHash = md5($contents)))
{
echo " the content is the same";
}
else
{
$from = "Heimdall";
$EmailTo = "smckannur@gmail.com,sourab.cc@gmail.com"; // Your email address here
$Subject = "WEBSITE MODIFICATION ALERT";
$headers.= "MIME-version: 1.0
";
$headers.= "Content-type: text/html; charset=iso-8859-1
";
$headers.= "From: $from
";
$message = '<html><body>';
$message.= '<p>This is an automated response from mysite.The bridge is open.</p><br>';
$message.= '<p>m7mysite has been updated.</p>';
$message = '</body></html>';
$success = mail($EmailTo, $Subject, $message,$headers);
// store the new hash in the file
$fp = fopen('../heimdall/heimdall.txt', 'w');
fwrite($fp, $pageHash);
fclose($fp);
}