-   Linux - Software (
-   -   Mail Header : Different refturn address (

vaibhavs 08-15-2009 02:26 AM

Mail Header : Different refturn address

I am writing a PHP script in which I would like the replies to come to an alternate address.

The header section of my PHP is:


        $headers = "MIME-Version: 1.0 \r\n";
        $headers .= "From: \"\" <>\r\n";
        $headers .= "Reply-To: <>\r\n";
        $headers .= "Errors-To: <>\r\n";
        $headers .= "Return-Path: <>\r\n";
        $headers .= "Date: ".date("r")."\r\n";
        $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
        $headers .= "Content-Transfer-Encoding: 8bit\r\n";
        $sHead = "";
        mail ("", $sub, $msg, $headers, $sHead);

But this is not working. When I send an email to my GMail account and hit REPLY, the email address showing in the To: is my own gmail address.
I need the To address to be

Pls help what am I missing ?


windtalker10 08-15-2009 01:07 PM

This isn't the answer you're looking for but every email I have ever received that was from a donotreply address stated the mailbox was not monitored so any replies would go unanswered.
If you don't want replies it might be easier to just figure out how to block all incoming mail.

AlucardZero 08-15-2009 02:15 PM

I don't know how the mail() command works, but do you need another \r\n after the last header?

vaibhavs 08-16-2009 01:22 AM

@windtalker10, I would still like to learn how to setup a different return address as per the RFC (assuming its there).

@AlucardZero, the above code works fine; so you may start with this code and adapt it further.

This post is still open.
I look forward to answers or pointers.


All times are GMT -5. The time now is 08:56 AM.