$subject="Page Not Found on ".$_SERVER['SERVER_NAME'];
$message="A visitor to your website received a 404 error. This visitor attempted to access nonexistent content on your website. They may have followed a bad link, or they may have been attempting something malicious. Either way, it could be something for you to look into.
Visitor IP address: $ip
Requested page: $requested
";
if(isset($referrer)&&$referrer){
$message.="They say they were referred by: $referrer";
}else{
$message.="This visitor's browser did not supply referral data.";