return path of mail function
| From: | Andrew Darrow | Date: | Sun, 02 Apr 2006 20:23:31 +0000 |
| Subject: | return path of mail function | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-233089@lists.php.net to get a copy of this message | ||
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');
And here's the headers that come in:
Return-path: <nobody@amsterdam.servershost.net>
Envelope-to: sub@drewpydraws.com
Delivery-date: Sun, 02 Apr 2006 15:19:45 -0500
Received: from nobody by amsterdam.servershost.net with local (Exim 4.52)
id 1FQ933-00082V-8q
for sub@drewpydraws.com; Sun, 02 Apr 2006 15:19:45 -0500
To: sub@drewpydraws.com
Subject: Test sub
X-PHP-Script: www.drewpydraws.com/crap.php for ip address
From: Test <test@test.com>
Reply-To: Test <test@test.com>
Message-Id: <E1FQ933-00082V-8q@amsterdam.servershost.net>
Date: Sun, 02 Apr 2006 15:19:45 -0500
X-Antivirus: AVG for E-mail 7.1.385 [268.3.4/299]
Mime-Version: 1.0
Content-Type: text/plain
The "From" and "Reply-To" get set correctly so it works fine on e-mail clients,
but some of the messages will be delievered to cell phones that display the return-path instead of
from and reply-to.
Any thoughts on how I would go about setting the value for Return-Path?
~Drew
www.drewpydraws.com