NYCPHP Meetup

NYPHP.org

[nycphp-talk] Emails not being received when using mail()

Hans Kaspersetz hans at cyberxdesigns.com
Mon Jan 14 20:11:34 EST 2008


So my guess is that the address the mail is coming from doesn't exist or 
the headers are malformed.  Send us the complete headers for on of your 
generated emails.

It should look like:

Subject: foo bar
From: blah blah <blahblah at cyberxdesigns.com>
Date: Mon, 14 Jan 2008 19:09:03 -0600
To: "Blah blah" <blahblah at cyberxdesigns.com>
Return-path: <blahblah at cyberxdesigns.com>
Envelope-to: blahblah at cyberxdesigns.com
Delivery-date: Mon, 14 Jan 2008 20:09:01 -0500
Received: from [189.149.170.20] (helo=[192.168.0.198]) by 
host.cxdhosting.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) 
(envelope-from <blahblah at cyberxdesigns.com>) id 1JEaIR-0006mC-1b for 
blahblah at cyberxdesigns.com; Mon, 14 Jan 2008 20:08:55 -0500
Message-ID: <478C07AF.9 at cyberxdesigns.com>
User-Agent:
Thunderbird 2.0.0.9 (Windows/20071031)


That will start to help us pin point what the problem is.

Hans

B.A.S. wrote:
> Ken Robinson wrote:
>> Get a SPF record on the DNS Zone for the domain. A PTR record is also 
>> good, but the hosting company usually has to do that one.
>>
>> As for the mail() function itself, use the "optional" 5th parameter 
>> to set the "Return-path:" header. Set it to "-f 
>> username at the.domain.in.question". The username doesn't have to exist. 
>> Some domains like AOL will throw away email where domain in the 
>> "Return-path:" header doesn't match the domain in the "From:" header.
>>
>> Ken
>
> I've heard of SPF records before, but not PTR, so I'll go educate 
> myself more on both counts to see if I can remedy the situation. The 
> hosting company in question is pretty accommodating, so they may be 
> willing to help.
>
> I'll try that 5th parameter and see what happens. Luckily, for this 
> particular script the "From:" header is hard-coded.
>
> Thanks,
> Bev
> _______________________________________________
> New York PHP Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> NYPHPCon 2006 Presentations Online
> http://www.nyphpcon.com
>
> Show Your Participation in New York PHP
> http://www.nyphp.org/show_participation.php
>



More information about the talk mailing list