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 = "_______@gmail.com";
$pfw_message = "$kontakt\n";
@mail($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
 
header("Location: result.html");
 
?>
Link to comment
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.

Edited by mac_gyver
removed disallowed content
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.