Safe mode is indeed off and sendmail_from has "no value". I've modified the
code as below:

$return="test@test.com";
$orig_sendmail_from = ini_get('sendmail_from');
ini_set('sendmail_from', $return);

$headers =  "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);

Still doesn't work. I also tried modifying the5th argument as
"[EMAIL PROTECTED]" and "[EMAIL PROTECTED]" 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" <[EMAIL PROTECTED]>
To: "Andrew Darrow" <[EMAIL PROTECTED]>
Cc: <php-general@lists.php.net>
Sent: Sunday, April 02, 2006 5:02 PM
Subject: Re: [PHP] 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@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
>
>
>
>
>
> -- 
> 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

Reply via email to