Safe mode is indeed off and sendmail_from has "no value". I've modified the code as below: $return="test@xxxxxxxx"; $orig_sendmail_from = ini_get('sendmail_from'); ini_set('sendmail_from', $return); $headers = "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); Still doesn't work. I also tried modifying the5th argument as "-ftest@xxxxxxxx" and "-f.test@xxxxxxxx" neither of those worked either. I'm not sure what i'm missing here. If it would help to view the phpinfo from my host, you may do so here http://drewpydraws.com/phpinfo.php ~Drew www.drewpydraws.com ----- Original Message ----- From: "Chris" <dmagick@xxxxxxxxx> To: "Andrew Darrow" <vrspectre@xxxxxxxxx> Cc: <php-general@xxxxxxxxxxxxx> Sent: Sunday, April 02, 2006 5:02 PM Subject: Re: return path of mail function > 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 > > > > > > -- > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.1.385 / Virus Database: 268.3.4/299 - Release Date: 3/31/2006 > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php