Re: Mail From option in PHP.ini

From: Date: Sun, 20 Jul 2003 18:29:53 +0000
Subject: Re: Mail From option in PHP.ini
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-155990@lists.php.net to get a copy of this message
> From the php website, it appears that the -fme@myaddress.com can be > put in the fifth parameter of the mail() function: > > Example 3. Sending mail with extra headers and setting an additional > command line parameter. > > mail("nobody@example.com", "the subject", $message, > "From: webmaster@$SERVER_NAME", "-fwebmaster@$SERVER_NAME"); > > > Note: This fifth parameter was added in PHP 4.0.5. Since PHP 4.2.3 > this parameter is disabled in safe_mode and the mail() function will > expose a warning message and return FALSE if you're trying to use it. I followed this recent thread with some interest, because I'd like to be able to set the return-path header for a script that emails to a large list, which would in turn allow me to identify bounced emails. I'm using a shared host server, with PHP running as the master account user name, so the return-path for emails is something like "Return-Path: <user@servername.hostcompany.com>". I had accepted that I could not change the return-path value with PHP, but reading about this fifth parameter renewed my hope that I could. I tried adding a fifth parameter to mail() in order to do this, like so: // fifth mail() parameter to set envelope sender $cmd_line_param = "-falert@my_domain.com"; mail("$fullname<$email>", $subject, $message, $headers, $cmd_line_param); This didn't change the return-path header. Perhaps the problem is that I have no idea what the syntax of the command line parameter is (what the "-f" does). Can anyone advise? Is it possible to use this fifth parameter to set the return-path header, and if so, what's the syntax? TIA, -- Lowell Allen

« previous php.general (#155990) next »