LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Mail Header : Different refturn address (https://www.linuxquestions.org/questions/linux-software-2/mail-header-different-refturn-address-747702/)

vaibhavs 08-15-2009 02:26 AM

Mail Header : Different refturn address
 
Hi,

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:

Code:

        $headers = "MIME-Version: 1.0 \r\n";
        $headers .= "From: \"Jobs@mydomain.com\" <jobs@mydomain.com>\r\n";
        $headers .= "Reply-To: <webmaster@mydomain.com>\r\n";
        $headers .= "Errors-To: <webmaster@mydomain.com>\r\n";
        $headers .= "Return-Path: <webmaster@mydomain.com>\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 = "-fwebmaster@mydomain.com";
        mail ("vaibhav@gmail.com", $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 donoreply@mydomain.com.

Pls help what am I missing ?

Thx
Vai

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.

Thx
Vai


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