etrader Posted June 2, 2011 Share Posted June 2, 2011 I explored the interest for tips for avoiding spam filtration of mails sent via mail(). My headers are: $headers = "From: Sender <[email protected]>\r\n"; $headers .= "Reply-To: Sender <[email protected]>\r\n"; $headers .= "Return-Path: Sender <[email protected]>\r\n"; $headers .= "Organization: Sender Organization\r\n"; $headers .= "X-Priority: 1\r\n"; $headers .= "X-MSMail-Priority: High\n"; $headers .= "Importance: High\n"; $headers .= "X-Mailer: PHP". phpversion() ."\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=utf-8\r\n"; 1. I am running the script on http://mail.example.com; do I need to run on http://example.com or subdomain is OK? 2. Do you have any other suggestion or advice to increase the chance of successful sending the emails? Quote Link to comment https://forums.phpfreaks.com/topic/238245-how-to-pass-spam-filters-with-php-mail/ Share on other sites More sharing options...
PFMaBiSmAd Posted June 2, 2011 Share Posted June 2, 2011 The two most common reasons why valid email gets voted as spam are - 1) You don't have a SPF DNS record that identifies your mail server as being authorized to send email for the domain in From: address - http://www.openspf.org/ 2) You are putting an email address into the From: address that doesn't match the domain at the sending mail server. Quote Link to comment https://forums.phpfreaks.com/topic/238245-how-to-pass-spam-filters-with-php-mail/#findComment-1224377 Share on other sites More sharing options...
etrader Posted June 2, 2011 Author Share Posted June 2, 2011 Thanks for your informative reply, PFMaBiSmAd 1. My DNS is setup externally by Godaddy. I added SPF record through its DNS wizard. Do I need to setup OpenSPF on my Postfix in my VPS? Or it is merely a DNS issue? 2. I added all A records (including a subdomain hosted with a dedicated IP, different from main domain). Now can I run mail() on http://subdomain.domain.com for sending from [email protected]? or I must necessarily run the php script from http://domain.com? Quote Link to comment https://forums.phpfreaks.com/topic/238245-how-to-pass-spam-filters-with-php-mail/#findComment-1224417 Share on other sites More sharing options...
etrader Posted June 3, 2011 Author Share Posted June 3, 2011 I think another important issue is to have reverse DNS. Should rDNS be pointed to the main domain or it is enough to be pointed to a subdomain of the main domain? Quote Link to comment https://forums.phpfreaks.com/topic/238245-how-to-pass-spam-filters-with-php-mail/#findComment-1224541 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.