2
there is no way to prevent it. That really isnt a spam mail, it is junk mail. Well if ur site is popular it will happen. The only way to do anything about it is add an ip send in the form going to the email.
I created a contact us form and it sent the ip in my email.
Here is what the contact form looks like:
<html>
<head>
<title>Email Form </title>
</head>
<body>
<form name="frm" method="post" action="sendeail.php" onSubmit="return validate(frm)">
<!-- DO NOT change ANY of the php sections -->
<?php
$ipi = getenv("REMOTE_ADDR");
$httprefi = getenv ("HTTP_REFERER");
$httpagenti = getenv ("HTTP_USER_AGENT");
?>
<input type="hidden" name="ip" value="<?php echo $ipi ?>">
<input type="hidden" name="httpref" value="<?php echo $httprefi ?>">
<input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>">
<font size="2"><b>
Your Name:* <br>
<input type="text" name="visitor" size="35">
<br>
Your Email:*<br>
<input type="text" name="visitormail" size="35">
<br /> <br />
Copy Sender ? No<input checked="checked" name="ccopy" type="radio" value="ccno" /> Yes<input name="ccopy" type="radio" value="ccyes" /> <br />
<br>
Subject:*<br>
<select name="attn" size="1">
<option value=" General Support ">General Support
<option value=" Ordering Support ">Ordering Support
<option value=" Technical Support ">Technical Support
<option value=" Templates Support ">Templates Support
<option value=" Templates Support ">Application
<option value=" Webmaster ">Webmaster
</select>
<br><br>
Mail Message:*
<br>
<textarea name="notes" rows="4" cols="40"></textarea>
Required*
<br>
<input type="submit" value="Send Mail">
<SCRIPT LANGUAGE="JavaScript">
<!--
function validate(frm)
{
if (frm.visitor.value.length == 0)
{
alert("Please enter your name");
frm.visitor.focus();
return false;
}
if (frm.visitormail.value.length == 0)
{
alert("Please enter an e-mail address");
frm.visitormail.focus();
return false;
}
if (frm.visitormail.value.indexOf("@") == -1)
{
alert("Please enter a valid e-mail address");
frm.visitormail.focus();
return false;
}
if (frm.visitormail.value.indexOf(".") == -1)
{
alert("Please enter a valid e-mail address");
frm.visitormail.focus();
return false;
}
if (frm.notes.value.length == 0)
{
alert("Please enter your message");
frm.notes.focus();
return false;
}
}
//-->
</SCRIPT>
</form>
</font></b>
</body>
</html>
And here is the sendeail:
<html>
<head>
<title>Sendemail Script</title>
</head>
<body>
<!-- You must enter YOUR email address ($myemail shown below).
Then you should check (or modify) the link for the 'next page' (at the bottom) -->
<?php
$myemail = "burnzy@burnsdesign.org";
$badinput = "<h2>Feedback was NOT submitted</h2>n";
if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,".")))
{
echo "<h2>Use Back - Enter valid e-mail</h2>n";
echo $badinput;
}
if(empty($visitor) || empty($visitormail) || empty($notes )) {
echo "<h2>Use Back - fill in all fields</h2>n";
echo $badinput;
}
$todayis = date("l, F j, Y, g:i a") ;
$attn = $attn . "(" . $ccopy . ")" ;
$subject = $attn;
$notes = stripcslashes($notes);
$message = " $todayis [EST] n
Subject: $attn n
Message: $notes n
From: $visitor ($visitormail)n
IP: $ip n
Browser Info: $httpagent n
";
$from = "From: $visitormailrn";
if ($myemail != "")
mail($myemail, $subject, $message, $from);
if (($ccopy == "ccyes") && ($visitormail != ""))
mail($visitormail, $subject, $message, $from);
?>
<b><p align="center">
Date: <?php echo $todayis ?>
<br>
Thank You : <?php echo $visitor ?> ( <?php echo $visitormail ?> )
<br>
Subject: <?php echo $attn ?>
<br>
Message: <?php echo $notes ?>
<br>
<?php echo $ip ?>
<br><br>
<a href="contact2.php"> Back to Contact Form </a>
</body>
</html>