LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-15-2009, 01:26 AM   #1
vaibhavs
Member
 
Registered: Jun 2008
Posts: 113

Rep: Reputation: 15
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
 
Old 08-15-2009, 12:07 PM   #2
windtalker10
Member
 
Registered: Nov 2007
Location: Kentucky
Distribution: Slackware13.1
Posts: 214

Rep: Reputation: 38
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.
 
Old 08-15-2009, 01:15 PM   #3
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
I don't know how the mail() command works, but do you need another \r\n after the last header?
 
Old 08-16-2009, 12:22 AM   #4
vaibhavs
Member
 
Registered: Jun 2008
Posts: 113

Original Poster
Rep: Reputation: 15
@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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to change mail header yukinK Linux - Server 1 10-13-2007 01:29 PM
Rejecting non local mail for specific e-mail address vrsic Linux - Server 4 10-24-2006 02:46 AM
can i use a from header to use the $mail command dsids Linux - Newbie 1 10-19-2006 05:39 PM
changing mail header Van jan Linux - Security 1 03-30-2004 11:03 AM
userdefined address header masquerading desperatescript Linux - Networking 0 08-25-2001 08:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration