Jump to content

gmail flagging email as spam


magicgolub

Recommended Posts

HI, i have a problem, a big one.
I used a php script to send some info from my html forms to my gmail. So it functions easy, somebody fills out the form and he click send, after that, his information is sent to me on my gmail, and i can work with it later. Now stupid google have some new filters (from year 2014 ) and it treats some of those mails as spam. Code is written in the way that allows me to get those mails as it is sent from the user himself, from his email. Can anybody correct my script so it won't be treated as a spam, because i know it is possible but don't know how...
here is the code - https://gist.github.com/anonymous/f56ba67145d500c5cf47
 

// Receiving variables
@$email = addslashes($_POST['email']);
@$kontakt = addslashes($_POST['kontakt']);
 
// Validation
if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $email))
{
header("Location: error.html");
exit;
}
 
if (strlen($email) == 0 )
{
header("Location: error.html");
exit;
}
 
if (strlen($kontakt) == 0 )
{
header("Location: error.html");
exit;
}
 
//Sending Email to form owner
$pfw_header = "From: $email\n"
. "Reply-To: $email\n";
$pfw_subject = "kontakt";
$pfw_email_to = "[email protected]";
$pfw_message = "$kontakt\n";
@mail($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
 
header("Location: result.html");
 
?>
Link to comment
https://forums.phpfreaks.com/topic/290369-gmail-flagging-email-as-spam/
Share on other sites

Having the From set to the persons email is likely part of the reason it's being spammed.  The From should be your domain, then you can whitelist your own domain in your gmail account.  You can leave the reply to the person that emailed you.  But honestly there is a LOT more to it than that for reliable delivery.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.