Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending to AOL mailboxes with PHP mail()

Status
Not open for further replies.

Foamcow

Programmer
Nov 14, 2002
6,092
GB
Does anyone here have experience of problems sending email to AOL accounts using mail()?

i.e. The mail just disappears, no errors, it doesn't go to the user's spam folder etc?

Tests I've done show that the mail does hit AOL. But it then vanishes.
If I send to a fictious mailbox then an error is returned.
If I send to the 'real' mailbox then the mail just vanishes.

Sending to 'normal' mailboxes and a gmail account work. But sending to a Hotmail account also seems to fail.

From this I am surmising that it's a header issue


Since the problem is that I'm trying to get a mail form on a website to work I have tried setting the from and return-path headers to reflect the domain that the webserver is under. Still no luck.


Here's what I'm currently using to test
The mail addresses in this example are, for the purposes of posting here, fictitious. The -f header sets the return path. But I have also tried without modifying this part of the header and just using From and Reply-To headers.

Code:
if(mail("mailbox@aol.com","Test email message - please confirm receipt", $message, "From:amailbox@gmail.com","-f amailbox@gmail.com")){
	echo("message sent");
} else {
	echo("Message failed");
}
?>

<honk>*:O)</honk>

Earl & Thompson Marketing - Marketing Agency Services in Gloucestershire
 
I think I read somewhere (maybe php.net) that in some cases each header must end with "\r\n
 
The \r\n isn't the issue.
I've tried it that way too.

However, I just had some success.

Set the Return-Path to the Senders email address.
The message then gets through.

My example code seems to work.
I'd not checked the AOL box since trying that iteration.
oops.

My previous tests hadn't been set up the same way. The return path and FROM headers were different.

<honk>*:O)</honk>

Earl & Thompson Marketing - Marketing Agency Services in Gloucestershire
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top