Jump to content

How to Pass Spam Filters with PHP mail()?


etrader

Recommended Posts

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?

 

Link to comment
https://forums.phpfreaks.com/topic/238245-how-to-pass-spam-filters-with-php-mail/
Share on other sites

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.

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?

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.