SiteCrafting Blah Blah Blog
Nov. 30, 2007 at 1:05pm
Why is AOL denying email?
Try adding a parameter to the mail() function
Email debugging is often frustrating and time consuming. There could be numerous reasons why the email you attempted to send out through your code fails: routing issues, firewalls, company servers blacklisting or blocking incoming emails, spam filters, bad DNS records, and email header requirements. The last one can definetely lead to infinite frustration, as I have experienced in the past, and was recently the cause of why AOL was denying emails generated by the php mail() function.
I have learned that some of the free email hosting sites require certain headers be present in the email. If the header is missing something or is malformed, the hosting vendor blocks that email. It also seems like there is no acceptable standard, which increases the fickle nature of email. However, it should be noted that there are some php classes that appear to handle all those cases, such as the PHP PEAR MAIL package and PHP Mailer.
For my current case, AOL requires a sender envelope wrapper before it will accept an email. In order to do this, a parameter needs to be added to the mail() function.
$to = "ken@kensblog.com";
$subject = "Why is AOL blocking emails?";
$message = "Because AOL requires a sender envelop wrapper";
$headers = "From: postmaster@domain.com\nMIME-Version: 1.0\nContent-type: text/plain; charset=iso-8859-1\n";
$parameters = "-f postmaster@domain.com";
mail($to, $subject, $message, $headers, $parameters );The $parameters field is key to getting an email delivered to AOL. Any email delivery errors are sent to the email address, postmaster@domain.com. In addition, the email address must be a valid domain, otherwise AOL will deny the incoming email.
This link shows a list of parameters that you could add to the $parameters field and it also explains the "-f" parameter.
Below is an example of a valid header that should be accepted by AOL.
X-AOL-UID: 3317.422461254 'Added by AOL
X-AOL-DATE: Fri, 30 Nov 2007 1:05:25 PM Eastern Standard Time 'Added by AOL
Return-Path: <usweb@airstream.com> 'Added by the -f parameter
Received: from rly-da03.mx.aol.com...
Received: from servername.local...
Received: by servername.local ...
To: ken@kensblog.com
Subject: Why is AOL blocking emails?
From: postmaster@domain.com
Reply-To: postmaster@domain.com
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1;
Message-Id: <20071130180521.69A6EB69CDF@servername.local>
Date: Fri, 30 Nov 2007 10:05:21 -0800 (PST)
X-AOL-IP: 169.189.1.19
X-AOL-SCOLL-AUTHENTICATION: listenair ; SPF_helo : n
X-AOL-SCOLL-AUTHENTICATION: listenair ; SPF_822_from : <postmaster@domain.com>
X-Mailer: Unknown (No Version)
Posted in From the Workbench, PHP by Ken Foubert
Comments (0)
Add your comment below