Dear,
I have an error page which automatically sends me a mail. Few days it worked well that mean i received mail when visitors requested wrong page. But now problem after I have changed something.
I don't receive any mail, as I have tested requesting wrong pages and the script does not show any message. When I echo variables it shows vales.
Here is my total php code of document.
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Inform webmaster about error</title>
<link rel="stylesheet" type="text/css" href="../styles-test.css">
</head>
<body style="background-color: #FFFFFF">
<table border="0" width="100%" style="border-collapse: collapse">
<tr>
<td width="107">
<p align="center">
<img border="0" src="http://www.rubd.net/images/rubd.jpg" width="100" height="67"></td>
<td>
<p style="margin-left: 10px"> </p>
<div style="background-color: #99CCFF">
<p style="margin-left: 10px">Page Not Found</div>
<p style="margin-left: 10px"> </td>
</tr>
</table>
<?php
$reqlink= $_SERVER['REQUEST_URI'];
?>
<p align="center"> </p>
<p align="center"> </p>
<p align="center">Your requested page
<?php echo "<b>$reqlink </b>" ; ?>was not found.
We apologize this inconvenience. Either there is an error in server or your have requested a
wrong page. We recommend to recheck address you typed. </p>
<p align="center"> </p>
<p align="center">An email regarding this error has been sent to the
webmaster. We heartily welcome your further assistance to help us improve.</p>
<p> </p>
<p> </p>
<?php
//send email to webmaster
$mto="[email protected]";
$mfrom="[email protected]";
$msubject="The document was not found";
$mmessage="The user request the page <b>$reqlink</b> which was not found <br>Refering Page: <b>$HTTP_REFERER</b>, Browser: <b>$HTTP_USER_AGENT</b>, Sender IP: <b>$REMOTE_ADDR</b>, Sender Host: <b>$REMOTE_HOST</b>" ;
/* To send HTML mail, you can set the Content-type header. */
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
/* additional headers */
$headers .= "To: $mto\r\n";
$headers .= "From: $mfrom \r\n";
$headers .="Subject: $msubject \r\n";
/* and now mail it */
if (!$result=mail($mto, $msubject, $mmessage, $headers)) die();
?>
<p align="center">Contact:
<a href="contents/script/sendmail/
[email protected]">
[email protected]</a> </p>
</body>
</html>
pls. suggest me something