Re: return path of mail function
| From: | Chris | Date: | Mon, 03 Apr 2006 00:02:07 +0000 |
| Subject: | Re: return path of mail function | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-233090@lists.php.net to get a copy of this message | ||
Andrew Darrow wrote:
I'm having a problem setting the return-path using the mail function. I seem to be able to modify any of the other header information I want, but not this one item. Here's my code: $headers = "Return-Path: Test <test@test.com>\r\n" . "From: Test <test@test.com>\r\n" . "Reply-To: Test <test@test.com>\r\n"; $sub="Test sub"; $msg="Test msg"; $to="sub@drewpydraws.com"; mail($to, $sub, $msg, $headers, '-f test@test.com');No space between -f and the email. I assume your host doesn't have safe-mode on? (You can't use this method if so). Check a phpinfo page and look for: sendmail_from If that's set, this way won't do it either, you'll need to do: $orig_sendmail_from = ini_get('sendmail_from'); // this should match what phpinfo tells you but replace the email. so might be '-f'.$return_path ini_set('sendmail_from', $return_path); mail($to, $sub, $msg, $headers); and leave off the last parameter. -- Postgresql & php tutorials http://www.designmagick.com/