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="[EMAIL PROTECTED]";

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/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to