Confusing Problem With Email Delivery From My Site to AOL

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
entropy99
Forum Newbie
Posts: 2
Joined: Sat May 24, 2008 5:35 pm

Confusing Problem With Email Delivery From My Site to AOL

Post by entropy99 »

The confirmation emails sent from my website http://earthlandrealms.com when users sign up isn't being delivered to aol.com address's and some other email providers. The strange thing is if I send the same exact email manually using the web based email program Horde, on the same server, using the same email address, it gets delivered. Both Horde and the page sending the email are PHP. The only thing I can think of is that maybe the code is wrong somehow even though the emails do get delivered to gmail and others. Here's the code:

Code: Select all

$ism=mail($cgi['email'],"EarthlandRealms.com Activation e-mail","Welcome to Earthland Realms! \n Your username is: {$cgi['username']} \n Your activation password is {$pas} \n\nEarthlandRealms.com", "From: noreply@dontspamme.com");
LSJason
Forum Commoner
Posts: 45
Joined: Mon May 12, 2008 4:43 pm

Re: Confusing Problem With Email Delivery From My Site to AOL

Post by LSJason »

Certain e-mail providers have different rules regarding how their incoming e-mails are treated. What I would suggest, if you have the time and money, is to set up a FBL with AOL, allowing you to ensure a good percentage of delivery so long as you comply with CAN-SPAM.
entropy99
Forum Newbie
Posts: 2
Joined: Sat May 24, 2008 5:35 pm

Re: Confusing Problem With Email Delivery From My Site to AOL

Post by entropy99 »

The thing is AOL delivers my email when I send it from Horde, but not when my script sends it. As far as I can tell everything else is equal.
LSJason
Forum Commoner
Posts: 45
Joined: Mon May 12, 2008 4:43 pm

Re: Confusing Problem With Email Delivery From My Site to AOL

Post by LSJason »

With AOL, you need to set certain headers in the outgoing e-mail that you don't necessarily need for other mail carriers. Here's what seems to work for me:

Code: Select all

 
        $headers = "";
    $headers .= "From: $EMAIL_FROM<$EMAIL_FROM>\n";
    $headers .= "Reply-To: <$EMAIL_FROM>\n";
    $headers .= "X-Sender: <$EMAIL_FROM>\n";
    $headers .= "X-Mailer: PHP4\n"; //mailer
    $headers .= "X-Priority: 3\n"; //1 UrgentMessage, 3 Normal
    $headers .= "Return-Path: <$EMAIL_FROM>\n";
    $headers .= "Content-Type: text/html; charset=iso-8859-1\n";
    mail($EMAIL_TO,$EMAIL_SUBJECT,$EMAIL_TEXT,$headers);
 
Post Reply