Mail() function php sends the mails into the spam filters <p>I'm trying to send my newsletter from a php file to some contacts from a database. But when I'm sending the mail to a Google Mail account, the mail is going to the spam filters and not in Inbox. If I send the mail to a Yahoo Mail account, it's working perfectly.</p> <p>I tryed a lot of possibilities, and I wrote the code necessarry to be a nice e-mail but no result for G-Mail. If you can give me an idea to make my php function not so spammy, I would be grateful. Thanks in advance.</p> <p>The php code for this is:</p> <pre><code>function spamcheck($field) { $field=filter_var($field, FILTER_SANITIZE_EMAIL); if(filter_var($field, FILTER_VALIDATE_EMAIL)) { return TRUE; } else { return FALSE; } } if(isset($_REQUEST) &amp;&amp; isset($_POST['check'])) { if(!empty($_POST['check'])) { $mailcheck = spamcheck($_POST["from"]); foreach($_POST['check'] as $checkB) { if($mailcheck==FALSE) { echo "Invalid Imputs!"; } else { $to = $checkB; $headers = "Reply-To: Caron Chiropractic ".$_POST['from']."\r\n"; $headers .= "Return-Path: Caron Chiropractic ".$_POST['from']."\r\n"; $headers .= "From: Caron Chiropractic ".$_POST['from']."\r\n"; $headers .= "Organization: Caron Chiropractor\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; $headers .= "X-Priority: 3\r\n"; $headers .= "X-Mailer: PHP/" . phpversion(); $message = '&lt;table style="margin: auto; width: 500px; font-family: sans-serif, Verdana, Arial, Helvetica, sans-serif; text-align: center; border-width: 2px; border-color: #999999; box-shadow: 0 0 10px gray; background: #F0F0F0;"&gt; &lt;tr&gt; &lt;td style="width: 500px; background: #003366; -webkit-border-radius: 10px; -moz-border-radius: 10px; -ms-border-radius: 10px; -o-border-radius: 10px; border-radius: 10px;"&gt; &lt;img src="http://www.caronchiro.com/feedback/png/logo.png" alt="Logo" style="width: 200px;"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;br&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td style="height: 20px;"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;br&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;h3&gt;A friendly hello from Caron Chiropractic!&lt;/h3&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;br&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;p&gt;We would like to hear about your experience with us. If you have a moment, please take our two-question survey.&lt;/p&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;br&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;a href="http://www.caronchiro.com/feedback/survey.php" style="background: #003366; border: none; padding: 5px 10px 5px 10px; text-shadow: 1px 1px #000; color: #FFF; text-decoration: none; -webkit-border-radius: 10px; -moz-border-radius: 10px; -ms-border-radius: 10px; -o-border-radius: 10px; border-radius: 10px;"&gt;Take the survey!&lt;/a&gt;&lt;br&gt;&lt;br&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;p&gt;Thank you for helping us improve our services.&lt;/p&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;a href="http://www.caronchiro.com/feedback/unsubscribe.php?id='.md5($to).'" style="text-decoration: none; color: #003366;"&gt;Unsubscribe&lt;/a&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;br&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;p style="color: #B7B7B7;"&gt;CopyRight &amp;copy; 2014&lt;/p&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt;'; $subject = "A friendly hello from Caron Chiropractic!"; mail($to,$subject,$message,$headers); } } } } </code></pre>