Reply-To headers sent in php mail()

Reply-To headers sent in php mail()

Posted by: rockwell
Posted on: 2006-06-13 20:39:00

Hi,
First off, I'm new to Dreamhost and so far glad to be here.

I am teaching myself php and have run into a problem with the reply-to headers being sent by the mail() function.

When I check my e-mail the form submission arrives just fine but when I reply there are two other e-mail addresses in the reply-to field,
these are:
My@runts.dreamhost.com
testReply-To@runts.dreamhost.com

Obviously I am on runts and I am not including these addresses in my script.

I cannot figure out how to stop the server from sending these and any help would be greatly appreciated.

Thanks

Chris

Re: Reply-To headers sent in php mail()

Posted by: guice
Posted on: 2006-06-13 20:42:00

You setting a From: header? Set a from address and see if that solves it.

Re: Reply-To headers sent in php mail()

Posted by: rockwell
Posted on: 2006-06-14 08:28:00

I do have a From: header included but you got me to scutinize everything and it turns out I fixed it with this:

$mailheaders = "From: My website <name@domain.com>";
$mailheaders .= "rn";
$mailheaders .= "Reply-To: ".str_replace($unwanted,"",$email);

instead of this

$mailheaders = "From: My website <name@domain.com>";
$mailheaders .= "Reply-To: ".str_replace($unwanted,"",$email);

The new line(s), now it works fine. I tried to break it again with the new line(s) added to make sure that was the only problem and it seems like it is.

Thanks for the guidance

Chris

Re: Reply-To headers sent in php mail()

Posted by: guice
Posted on: 2006-06-14 09:22:00

That would cause the problem. get into the habit of adding the n to the end of every header line. It's required to spread the headers:
$mailheaders = "From: My Website <name@domain.com>n";

r is optional. I've never used it myself, but others have mentioned problems when not using it. The only problem I see happening is windows servers/mail clients. Since now, I believe, only windows that uses r today; Windows line breaks are "rn". I think MacOS is on n now; it use to be r in MacOS9 and prior.

Tags: mail addressesphp mailmail functionruntsdreamhostheadersappreciatedsubmissionobviouslyhelp