QUOTE(Niels @ Aug 11 2005, 10:46 AM)
Try this:
CODE
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\n";
$headers .= "X-Priority: 3\n";
$headers .= "X-MSMail-Priority: Normal\n";
$headers .= "X-Mailer: PHP\n";
$headers .= "From: \"".$name_sender."\" <".$sender.">\n";
$headers .="Return-Path: your@email.com\n";
return mail($email, $subject, $message, $headers);
That's alot more then what you asked for, this is the exact part you want:
CODE
$headers .="Return-Path: your@email.com\n";
But i would advice you to use the full headers as shown above (to keep the spam filters happy
), just modify a bit and it should work.
-
niels
Thanks, but that didn't work either.
Here is the actual code that I used with the actual e-mails so you can see the actual results:
<?php
$name_sender="Tim";
$sender="tim";
$email="timv@flutespirit.com";
$subject="TESTING";
$message="This is a test";
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\n";
$headers .= "X-Priority: 3\n";
$headers .= "X-MSMail-Priority: Normal\n";
$headers .= "X-Mailer: PHP\n";
$headers .= "From: \"".$name_sender."\" <".$sender.">\n";
$headers .="Return-Path: timv@violinbridgeworks.com\n";
mail($email, $subject, $message, $headers);
exit();
?>
Here is what the e-mail software received:Return-path: <nobody@server26.fastbighost.com>
Envelope-to: timv@flutespirit.com
Delivery-date: Fri, 12 Aug 2005 01:19:32 +0000
Received: from nobody by server26.fastbighost.com with local (Exim 4.51)
id 1E3OCq-0001LM-4u
for timv@flutespirit.com; Fri, 12 Aug 2005 01:19:32 +0000
To: timv@flutespirit.com
Subject: TESTING
MIME-Version: 1.0
Content-type: text/plain; charset=iso-8859-1
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: PHP
From: "Tim" <tim@server26.fastbighost.com>
Message-Id: <E1E3OCq-0001LM-4u@server26.fastbighost.com>
Sender: Nobody <nobody@server26.fastbighost.com>
Date: Fri, 12 Aug 2005 01:19:32 +0000If I click on the reply button in my e-mail software, the name that ends up going into the reply box is:
"timv@violinbridgeworks.com" <tim@server26.fastbighost.com>
If I go about it the othe way (with actual entries):<?php
$theMsg="This is a test";
mail("timv@flutespirit.com", "testing", $theMsg, "From: timv@violinbridgeworks.com\r\nReply-To: timv@violinbridgeworks.com");
?>The email received by my e-mail software looks like this:Return-path: <nobody@server26.fastbighost.com>
Envelope-to: timv@flutespirit.com
Delivery-date: Fri, 12 Aug 2005 01:46:03 +0000
Received: from nobody by server26.fastbighost.com with local (Exim 4.51)
id 1E3OcV-0005SX-Ht
for timv@flutespirit.com; Fri, 12 Aug 2005 01:46:03 +0000
To: timv@flutespirit.com
Subject: testing
From: timv@violinbridgeworks.com
Reply-To: timv@violinbridgeworks.com
Message-Id: <E1E3OcV-0005SX-Ht@server26.fastbighost.com>
Sender: Nobody <nobody@server26.fastbighost.com>
Date: Fri, 12 Aug 2005 01:46:03 +0000
This is a testIf I click on the reply button in my e-mail software, the name that ends up going into the reply box is:
timv@violinbridgeworks.com
Which is the way it should be, but it still has that funky "Received:" entry
Any other ideas how to get around this so that "Return-path:" ends up with the correct entry?