On my homepage I have a contact form with captcha.
The visitor gives his mail address and the form is sent to me,
but it arrives in my gmail spam folder. Is there a way to avoid that mails from my homepage are not considered as spam? I think maybe there might be a piece of a coding that I can introduce to my php mail script. I have tried with the header but the mail still goes into the spam folder.
Here my script:
<?php
$name = $_REQUEST["name"];
$subject = $_REQUEST["subject"];
$message = $_REQUEST["message"];
$from = $_REQUEST["from"];
$verif_box = $_POST["verif_box"];
// remove the backslashes that normally appears when entering " or '
$name = stripslashes($name);
$message = stripslashes($message);
$subject = stripslashes($subject);
$from = stripslashes($from);
// check to see if verificaton code was correct
if(md5($verif_box).'a4xn' == $_COOKIE['tntcon']){
// if verification code was correct start printing on the mail email the bottom to the top
$message = "Subject: ".$subject."\n\n".$message;
$message = "Name: ".$name."\n".$message;
$message = "From: ".$from."\n".$message;
$headers .= "Reply-To: <me@gmail.com>\r\n";
$headers .= "Return-Path: <me@gmail.com>\r\n";
$headers .= "From: $from\r\n";
mail("me@gmail.com", 'my form: '.$subject, $_SERVER['REMOTE_ADDR']."\n\n".$message, $headers);
// delete the cookie so it cannot sent again by refreshing this page
setcookie('tntcon','');
} else if(isset($message) and $message!=""){
// if verification code was incorrect then return to contact page and show error
header("Location: mail.php?name=$name&subject=$subject&from=$from&message=".urlencode($message)."&wrong_code=true");
exit;
} else {
echo "fill out the form completely";
exit;
}
?>
Is it because of
"$_SERVER['REMOTE_ADDR']."\n\n".$message "?
Thank you for your help