magicgolub Posted August 9, 2014 Share Posted August 9, 2014 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"); ?> Quote Link to comment Share on other sites More sharing options...
fastsol Posted August 9, 2014 Share Posted August 9, 2014 (edited) 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 August 10, 2014 by mac_gyver removed disallowed content Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.