Re: mail() -> How to change the sender

From: Date: Wed, 13 Nov 2002 20:14:44 +0000
Subject: Re: mail() -> How to change the sender
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-124304@lists.php.net to get a copy of this message
Hello, On 11/13/2002 03:46 PM, Duncan wrote:
all my scripts on my server, which use the mail() function, get the sender: nobody@domain.com where domain is the localdomain of the server and nobody is the user under which apache is running. So, now i recently saw an error in the logs, that some servers don't accept emails coming from a "nobody@" scheme. How can i change the sender, so that i can use s.th. else? Will i have to change the apache user to get rid of the "nobody"? I am not talking about the "From: " or "Reply To:" parameters, but the actual "Received: from nobody by domain.com with local (Exim ....) ....." line in the header. My server runs with RedHat 7.3 & latest apache 1.x & php versions.
Try mail() 5th parameter with -f switch. If you have trouble with that, try this class that lets you specify the sender address using the Return-Path: header: http://www.phpclasses.org/mimemessage -- Regards, Manuel Lemos

« previous php.general (#124304) next »