Re: php mail() function

From: Date: Sun, 25 Oct 2009 04:28:51 +0000
Subject: Re: php mail() function
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.general 
Request: Send a blank email to php-general+get-299314@lists.php.net to get a copy of this message
But it seems like the 'From:' address being given to the PHP mail() function is maybe being ignored, because the error log lists 'www-data@homemade' as being the sender, rather than listing the shaw address. The snippet from the PHP code: $email = $_POST['email']; ... mail($to, $subject, $msg, 'From:' . $email); I have tried setting both $to and $email to be the same shaw address since I assumed it should be recognized by the mail server, but it's still getting bounced. So why is 'www-data@homemade' being listed as the sender? Any ideas? On Sat, Oct 24, 2009 at 9:17 PM, James Prentice <prentice.j.a@gmail.com> wrote: > I also suspect that the problem is due to the sender address, but I > have tried using the shaw email address for the From: address that's > given to the mail() function and it still gets bounced. It seems like > the ISP should consider that address valid. > > > > On Sat, Oct 24, 2009 at 2:20 PM, Per olof Ljungmark <peo@bsdlabs.com> wrote: >> James Prentice wrote: >>> >>> It sends the bounced message to /var/mail/www-data and I get this: >>> >>> --19BE8A70109.1256417846/homemade >>> Content-Description: Delivery report >>> Content-Type: message/delivery-status >>> >>> Reporting-MTA: dns; homemade >>> X-Postfix-Queue-ID: 19BE8A70109 >>> X-Postfix-Sender: rfc822; www-data@homemade >>> Arrival-Date: Sat, 24 Oct 2009 13:57:26 -0700 (PDT) >>> >>> Final-Recipient: rfc822; xxx@shaw.ca >>> Action: failed >>> Status: 5.0.0 >>> Diagnostic-Code: X-Postfix; shawmail.vc.shawcable.net >>> >>> --19BE8A70109.1256417846/homemade >>> Content-Description: Undelivered Message >>> Content-Type: message/rfc822 >>> >>> Received: by homemade (Postfix, from userid 33) >>>        id 19BE8A70109; Sat, 24 Oct 2009 13:57:26 -0700 (PDT) >>> To: xxx@shaw.ca >> >> Although 5.0.0 actually means something else I'm pretty sure you are >> rejected because of an invalid sender address or domain. Use a sender >> address that is valid with your ISP's mail relay. >> >> Just my $0.02 >> >> -- >> per >> >

« previous php.general (#299314) next »