Re: return path of mail function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxx>\r\n" .
   "From: Test <test@xxxxxxxx>\r\n" .
   "Reply-To: Test <test@xxxxxxxx>\r\n";

$sub="Test sub";
$msg="Test msg";

$to="sub@xxxxxxxxxxxxxxx";

mail($to, $sub, $msg, $headers, '-f test@xxxxxxxx');

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux