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 <sender@example.com>\r\n";
$headers .= "Reply-To: Sender <sender@example.com>\r\n"; 
$headers .= "Return-Path: Sender <sender@example.com>\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
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.

Link to comment
Share on other sites

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 sender@domain.com? or I must necessarily run the php script from http://domain.com?

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.