AOL Mailing Service (Undelivered Mail Returned to Sender) HTML & PHP

Hey Guys,
I’m trying to trouble shoot this problem I am having. I am getting Undelivered Mail Returned to Sender from only AOL users but the emails are coming through to me. But I do also notice that the emails are being sent from the user entering the giveaway not mine.

P.S. I have removed the business name from the code.

Thanks guys!

HTML:
[php]

            <tr>
              <td align="center"><br>

ENTER GIVEAWAY









Full Name:
              <input  type="text" name="name" maxlength="50" size="30" style="color:#000;  width:100%;" required> </td>
             </tr>
            <tr>
              <td><label for="email">

Email Address:

Confrim Email:



 I agree to the Terms & Conditions


[/php]

PHP:
[php]<?php

// first clean up the input values
foreach($_POST as $key => $value) {
if(ini_get(‘magic_quotes_gpc’))
$_POST[$key] = stripslashes($_POST[$key]);

$_POST[$key] = htmlspecialchars(strip_tags($_POST[$key]));
}

$ip=$_SERVER[‘REMOTE_ADDR’];
$email_to = “[email protected]”;
$email_subject = “50 Daily Entry”;

$email_message .= “Name Entered: “.$_POST[“name”].”\n”;

$email_message .= “Email Address: “.$_POST[“email”].”\n”;

$email_message .= “Confirm Email: “.$_POST[“cemail”].”\n”;

$email_message .= “I agree: “.$_POST[“agree”].”\n”;

$userEmail = filter_var( $_POST[‘email’],FILTER_VALIDATE_EMAIL );

if( ! $userEmail ){

exit;

}

//email headers

$headers = 'From: '.$_POST[“email”]."\r\n".

'Reply-To: '.$_POST[“email”]."\r\n" .

‘X-Mailer: PHP/’ . phpversion();

echo (mail($email_to, $email_subject, $email_message, $headers) ? "
":“

We’re sorry, something went wrong.

Please return to .

”);

$ip=$_SERVER[‘REMOTE_ADDR’];
$email_to = $_POST[“email”];
$email_subject = “Daily Cash Giveaway |”;

$email_message1 = "Welcome to!

Thank you for entering to win 50 dollars from the cash giveaway. Please check this email address later to see if your the lucky winner!

Sincerely,

";

//email headers

$headers = 'From: '.$_POST[“email”]."\r\n".

'Reply-To: '.$_POST[“email”]."\r\n" .

‘X-Mailer: PHP/’ . phpversion();

echo (mail($email_to, $email_subject, $email_message1, $headers) ? “”:"");

// Required field names
$required = array(‘name’, ‘email’);

// Loop over field names, make sure each one exists and is not empty
$error = false;
foreach($required as $field) {
if (empty($_POST[$field])) {
$error = true;
}
}

if ($error) {
echo “All fields are required.”;
} else {
echo “Proceed…”;
}

?>[/php]

Welcome back, Itskater…

I had this problem over and over and found it to be the FROM address. It was something to do with the new
versions of “DMARC Rejection” which Yahoo, AOL, Gmail and others now use. You can google it to read about
it further. This is an email protection system that seems to try to cut down on spammers while it just wreaks
havoc on websites that send out contact-us types of messages…

On one of my Godaddy servers, I got it to work finally by using creating a Godaddy email account linked to my
domain name and using that as the FROM address. I used the REPLY-TO address to place the user’s email instead
of placing it inside the FROM address. Therefore, when the message was sent to the ADMIN or SALES or other
person reading the emails, the FROM address would be the domain and the REPLY-TO would be whoever wrote
the email. Does that make sense? Read up on the DMARC issues on Google if you need more info…

In your code, you set both the FROM and the REPLY-TO to the user’s email they typed in. Try to use your own
server’s email account for the FROM. If you don’t have an email account set up in your domain, do so and use
it. I created one that was like [email protected], etc and don’t use it at all and never get mail to it, but it does
solve the DMARC issues…

Hope that helps…

Hey ErnieAlex,
Thanks for the reply! I get what your saying about the spam problem with Yahoo and AOL for me. I have tried changing the “From:” and the “Reply-To:” to my server email [email protected] without luck. I will either still get the error of the email wont go through. >:(

Well, I assume you changed the [email protected] to your real live email at your domain, right?
The email address in the FROM must be an email account on your server. You can test it by sending
yourself an email to that account. Then, if it does not work, you can view your server’s log to see where
it fails. Depending on the hosting company you use, this is often easy to view in the control panel.

To make sure that we are clear, if your server’s email address is Ernie[member=76242]itskater91[/member].com… You would need
to use this set in your mail headers:
‘From: Ernie[member=76242]itskater91[/member].com’ . “\r\n” .
‘Reply-To: Ernie[member=76242]itskater91[/member].com’ . “\r\n” .
The return path can be something else, but the FROM address MUST match your website’s server’s email…

Yes, you are correct I changed the email address to “mydomain”

Yet I am still having the same problem when the email is sent. Ive tried every way of changing the “email” to my domain email in all 4 spots in the code. I’m string to find the error report right now.

Does it send to yourself okay? I mean, first make sure the email is sending out to your own account.

If that works, try sending one to a non-aol/yahoo/gmail account and see if they get it. (I can give you a test
email address by private message if you do not know someone to test with.)

If that works, then there is nothing wrong with your code except the DMARC issues. I tested on a GoDaddy
server that I own and it took a lot of work to get it to send me an email on one email drop I have that is AOL.
It just didn’t go out. I tracked it down to being teh DMARC issue. Changing the FROM worked on that server.

What hosting company are you using? Oh, also, I found that my emails to the AOL address always went into
the spam filter until I told it the server was not spam. All okay after that. When you tested, did you have the
AOL person check their spam folder?

Yes, I will always receive the email to my domain email but not the AOL / Yahoo email address. I have created both a yahoo and AOL account to test the code. With “email” written in I receive the email and the user receives a failure notice just like your explaining. When editing the code to "[email protected]" I get 3 different results, one neither receive the email, two I receive and not the user, or the user receives and I dont. Messing with the “From” has only made the code stop working.

I went thru all those same issues and tests and jumped thru all the hoops when I had that problem in the past.
Finally, I got it to work. It was on my Godaddy server. For it, I had to create an email account for that domain
and use it in the FROM header.

Well, I took my email code, built a small one page test for you to send out to AOL for you to run on your server.
I actually had it send it to three of my accounts all different domains and different hosting companies. I did get
all three of the emails back in my inboxes. So, I know this code works. Try this test and let us know if it works
or fails. (Change your TO addresses to your three test address and the FROM to your server’s email account)
I copied this to my server. Went online and went to the page. It said the email was sent. I refreshed and it
sent it a second time. I got all six emails back in the three email accounts. Try this with your addresses and
report back…
[php]

<?PHP $message_text = "testing from server to AOL email..."; $subject = "Testing AOL emails..."; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'From: Important Message from the Ernie! ' . "\r\n";
mail('[email protected], [email protected], [email protected]', $subject, $message_text, $headers);
echo "Email was sent...";

?>

[/php]
Sponsor our Newsletter | Privacy Policy | Terms of Service