Hello,
My email is getting spammed badly by spambots.
I am currently using the following code for sending email from a form.
[code=php]
<?
$mailto = ‘[email protected]’ ;
$subject = “Feedback from test.co.uk” ;
$formurl = “http://www.test.co.uk/contact.html” ;
$errorurl = “http://www.test.co.uk/contact_error.html” ;
$thankyouurl = “http://www.test.co.uk/contact_ty.html” ;
$name = $_POST[‘name’] ;
$email = $_POST[’email’] ;
$comments = $_POST[‘comments’] ;
$http_referrer = getenv( “HTTP_REFERER” );
if (!isset($_POST[’email’])) {
header( “Location: $formurl” );
exit ;
}
if (empty($name) || empty($email) || empty($comments)) {
header( “Location: $errorurl” );
exit ;
}
if (get_magic_quotes_gpc()) {
$comments = stripslashes( $comments );
}
$messageproper =
“This message was sent from:n” .
“$http_referrern” .
“————————- COMMENTS ————————-nn” .
$comments .
“nn————————————————————n” ;
$messageproper = eregi_replace(“@”, “”, $messageproper);
$name = eregi_replace(“@”, “”, $name);
mail(strip_tags($mailto), strip_tags($subject), strip_tags($messageproper), “From: “$name” <$email>nReply-To: “$name” <$email>nX-Mailer: chfeedback.php 2.02″ );
header( “Location: $thankyouurl” );
exit ;
?>
Is there anything I should do to this script to make it unspammable ?
Thanks in advance,
Michael.