On 11/19/2003 08:09 PM, Glenn Gasner wrote:
Here is the code I'm using trying to replace [EMAIL PROTECTED] with my email address when I use the PHP mail() function to send a message:
$headers="From: Glenn Gasner <[EMAIL PROTECTED]>\r\n" ."Reply-To: Glenn Gasner <[EMAIL PROTECTED]>\r\n" ."Return-Path: Glenn Gasner <[EMAIL PROTECTED]>"; mail("[EMAIL PROTECTED]","Website Comment",$comments,$headers,"-f [EMAIL PROTECTED]");
With all of that the Return-Path is always still [EMAIL PROTECTED], or in my case:
Return-Path: [EMAIL PROTECTED]
which is the shared server I'm on which doesn't return bounced messages to me. I've tried every variation of spaces, parenthesis and variables that I can think of and I can't get the return path to budge. I included my mail() command in an 'if' statement and it came out as "true," so my understanding is that means my host isn't running in "safe mode" which might deactivate the -f option. Some posts alluded to an apache permission needing to be set, but there were no details and the Apache site didn't easily show what permission I need to request changed so that I can modify the Return-Path in outgoing email. Is there something I'm overlooking, or something I should change, or should I just abandon the mail() command altogether and try to use one of the more cryptic variations mentioned in some posts (someone refered to 'popen' for mailing).
The Return-Path header does not do anything. It is the mailer that actually puts it there, not your script. You may also have other problems probably affected with bugs in the mail function.
Anyway, you may want to try this class that has work arounds to mail function bugs and emulates what you want by passing the Return-Path header:
http://www.phpclasses.org/mimemessage
--
Regards, Manuel Lemos
Free ready to use OOP components written in PHP http://www.phpclasses.org/
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php