Categories: Composing and Sending Messages :

PHP Reply-To Header Not Recognised??

Showing 1-36 of 36 messages
PHP Reply-To Header Not Recognised?? Luci 6/17/09 3:52 AM
Hi I have forms sent to me from my sites, and I've set up the php header in the mailing form to reply to the e-mail adress given on the form, but it ALWAYS defaults to the email address the form is sent to.
IE, the recepiants mail (m...@here.com) is always in the new To: box when i hit reply, instead of (th...@whereever.com)

Hotmail seems to work just fine reading them, I don't want to use them if I don't have to but.. it's a mega pain in the bum!
Re: PHP Reply-To Header Not Recognised?? KeithR 6/17/09 11:22 PM
It should work correctly.  Do you have the header syntax exactly right?  I just checked a message I received where the headers read like this:
Re: PHP Reply-To Header Not Recognised?? Luci 6/18/09 12:05 AM
I'm pretty sure it is, but it's entirely likely that i've been staring at it for so long that i'm no longer seeing it! This is what i've got:

    $recipient = "m...@here.com";
    $subject = "Form";

    $message = "{$_POST['name']} wants to trade! \n";
    $message .= "Name: {$_POST['name']} \n";
    $message .= "E-mail: {$_POST['email']} \n";
    $message .= "Trading Post: {$_POST['siteurl']} \n";   
    $message .= "TCG: {$_POST['tcg']} \n";
    $message .= "Cards Wanted: {$_POST['wanted']} \n";
    $message .= "Cards Offering: {$_POST['offering']} \n";

    $headers = "From: Euphoria:TP <$recipient> \n";
    $headers .= "Reply-To: <{$_POST['email']}>";


but whenever i click reply to the forms, it has my email (m...@here.com) in the reply-to box instead of the posted e-mail from the form...

Re: PHP Reply-To Header Not Recognised?? KeithR 6/18/09 2:30 AM
Try removing the angle brackets from the Reply-To.  Also have a look at how it all gets into the actual message by selecting Show original from the drop down when you have your message open.  Does it need a "\n" on the end of the Reply-To line?
Re: PHP Reply-To Header Not Recognised?? Luci 6/18/09 9:04 AM
Ok, have managed to get it to use the Reply-To function correctly -it seems to have something to do with the "."s before the "=". However now it doesn't display the "From" part right when it sends it. IE I code it so it should say "Site Name" in the Sender part when you're looking over the inbox, but now it has my MySQL name and server instead :S

Is GMail just a bit... incapable? :S
Re: PHP Reply-To Header Not Recognised?? KeithR 6/18/09 6:32 PM
Not meaning any offence, but your description sounds more like your programming is at fault.  If you use the Show original, you will be seeing the text that Gmail received.  Gmail can only interpret that to its best ability.
Re: PHP Reply-To Header Not Recognised?? KeithR 6/18/09 6:36 PM
PS: Look carefully at line beginnings.  Something as invisible as a space at the beginning of a line breaks the syntax for email messages.  The . in front of the equals sign is only a program construct that means add the bit to the right to what is already in that variable, but it must be hard up against the "=".  If a space creeps in there, the program will do something else entirely.
Re: PHP Reply-To Header Not Recognised?? XxDrAg0nxX 6/19/09 4:16 AM
I am in the Exact same situation.

When Someone sends me an email via my shopping cart form, i receive via pop mail account on gmail as:

from:  
customer <enq...@mydomain.com>
reply-to:  customer <Cust...@customer.com>
to:  enq...@mydomain.com

On Gmail, When I click reply, it auto replies to the "From", but its supposed to go to my customer "reply-to" address

On Thunderbird, it works fine, when i click reply, it will auto select the "reply-to" address.
Re: PHP Reply-To Header Not Recognised?? tbalthazar 7/3/09 8:42 AM
same problem here.
Re: PHP Reply-To Header Not Recognised?? XxDrAg0nxX 7/3/09 9:59 AM
Does this mean this is a common problem, but there is no solution to the problem yet? :(
Re: PHP Reply-To Header Not Recognised?? KeithR 7/4/09 11:37 PM
@XxDrAg0nxX,
Is your shopping cart self-configured or commercially set up?  All the messages I have received from commercial operations that use the Reply-To header have included ONLY the raw email address as in the Flight Centre example above or in Luci's code sample.

If you have self configured your cart, then change the Reply-To to contain only "<Cust...@customer.com>".  Gmail certainly handles this construct correctly.
Re: PHP Reply-To Header Not Recognised?? XxDrAg0nxX 7/5/09 7:45 AM
self configured, all default, but if Thunderbird / outlook / cpanel works fine... it should be to do with Gmail itself right? :(
Re: PHP Reply-To Header Not Recognised?? KeithR 7/5/09 2:59 PM
Certainly this is a behaviour of Gmail that is different from the others, but not necessarily a "bug".  The other clients might be written to allow for a variance from the email specification that Gmail hasn't allowed for.  Seems to me there would be a reason that the nick name has been left off from the commercial sites.

Re: PHP Reply-To Header Not Recognised?? daniel.treiber 7/8/09 7:24 AM
I am having the same problem as the people above. 
my php header is
$headers = "From: te...@test.com \n";
$headers .= "Reply-To: b...@foo.com \n";
$headers .= "MIME-Version: 1.0 \n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1 \n";

So in this example it replies to te...@test.com instead of b...@foo.com (even though gmail shows b...@foo.com as the reply-to)


Re: PHP Reply-To Header Not Recognised?? KeithR 7/8/09 6:45 PM
Try putting angle brackets around those email addresses e.g. <b...@foo.com>
Re: PHP Reply-To Header Not Recognised?? daniel.treiber 7/8/09 6:48 PM
Same problem as before, no difference. Oh and I miss spoke, it replies to the "to" email address not the from.
Re: PHP Reply-To Header Not Recognised?? KeithR 7/8/09 9:41 PM
I'd also be interested in seeing what happens if you remove the space after the address and before the "\n".  If there is still a problem, have a look at the actual message you receive using Show Original to see how the headers actually get through to Gmail.
Re: PHP Reply-To Header Not Recognised?? daniel.treiber 7/9/09 6:32 AM
Hmm the space thing didnt seem to change anything. The original shows what i expect 

From: <te...@test.com>
Reply-To: <b...@foo.com>
Is there any other information from the original message that would cause this?
Re: PHP Reply-To Header Not Recognised?? KeithR 7/9/09 6:25 PM
I'm a bit concerned about the way this reads from your post - it might be just the way the forum treats what you entered:
From: <te...@test.com> Reply-To: <b...@foo.com>Is ...
I note the space between the first "> and the "Reply".  I know that a space on the beginning of a line indicates a continuation of the line before in the Header part of an email message, but I can't tell where that space came from.  Was it on the end of the From line? OK; was it just created by the forum? OK; was it at the beginning of the Reply-To line? NBG!

A similar consideration needs to be given to the line following the Reply-To line.  It would have been cool if Luci or XxDrAg0nxX had posted a follow-up.

Re: PHP Reply-To Header Not Recognised?? XxDrAg0nxX 7/9/09 8:16 PM
Sorry tried those but still the same, it ignores the reply to and just replies to the from :(
Re: PHP Reply-To Header Not Recognised?? Catterbutts 7/10/09 2:12 AM
In cases where the Reply-To: is being ignored, are the From: address and To: configured in GMail Settings as 'Send As...' Accounts, with perhaps the 'Reply from the same address to which the message was sent' set?

I have long suspected a similar issue when sending mail to self (using different accounts) but it would be good to check it out using externally generated messages. 

Re: PHP Reply-To Header Not Recognised?? Catterbutts 7/10/09 3:17 AM
A quick test appears to suggest a bug in that the Reply-To: header is ignored when the To: address is registered as a 'Send As...' account in settings.

Can you confirm this is the case here and if so, conform that the problem disappears if you temporarily delete the account in settings? 


Re: PHP Reply-To Header Not Recognised?? XxDrAg0nxX 7/10/09 9:55 AM
Sorry I am lost here... what do you want me to try again?
Re: PHP Reply-To Header Not Recognised?? Catterbutts 7/10/09 10:02 AM
I believe I have proved (with my own tests) there is a bug when the incoming To: address is also set up in your settings as a 'Send Mail As...' account.

Can you confirm that you also have a 'Send Mail As...' account set up for the address you are receiving the messages at?
Re: PHP Reply-To Header Not Recognised?? XxDrAg0nxX 7/10/09 10:07 AM
OH..

Yup I do have them all listed there, just in case i need to change and send out using those.

I also have this activated:
When receiving a message:
Reply from the same address the message was sent to


Re: PHP Reply-To Header Not Recognised?? XxDrAg0nxX 7/10/09 10:12 AM
Ahh yes IF i were to remove the same email from the send mail as it will select the correct "send to" account :)

just that not its choosing the wrong account to send from :(
Re: PHP Reply-To Header Not Recognised?? ChrisG_UK 12/9/09 12:12 PM
I have experienced the same issue with a PHP contact form which sends mail to my Gmail account. If the "From" address is either the same as the "To" address, or is configured in GMail Settings as one of the 'Send As...' accounts, Gmail replies to the "To" address instead of the "Reply-To" address. An easy workaround is to specify a non-Gmail "From" address. Now it works and Gmail properly respects the "Reply-To" address. There is no doubt at all in my mind that this is a bug in Gmail.
Re: PHP Reply-To Header Not Recognised?? Joe Sauve 2/2/10 9:54 PM
Catterbutts, I too thought the same thing at first. My .NET app is sending email from a simple contact form. Let's say in the contact form, I specify my email address to be something like "areallyco...@gmail.com". This address is assigned to the "From" address in the generated contact email. The "To" portion of the generated contact email is my personal gmail account, "myperson...@gmail.com".

When I receive the email, it arrives as expected, with the From field containing "areallyco...@gmail.com" and the To field contains "myperson...@gmail.com". Note that "areallyco...@gmail.com" is NOT an account that I use the "send as" feature with; it is simply some random email address.

When I click "Reply", the "To" field of the reply email is populated with "myperson...@gmail.com" instead of the expected "areallyco...@gmail.com". Not sure what's going on here, but it's really annoying.
Re: PHP Reply-To Header Not Recognised?? KeithR 2/3/10 5:47 PM
Joe, is there a "reply-to" header in those messages?  This one will over-ride the From.
Re: PHP Reply-To Header Not Recognised?? bfred.it 5/22/10 8:07 AM
PROBLEM SOLUTION:
When sending the email to yourself, set both from and to to youremailadd...@gmail.com, and reply-to to yourema...@gmail.com
It also works with Google apps. Where in...@domain.com is my address, I set it as info...@domain.com

I receive the email from info...@domain.com and automatically reply to in...@domain.com 

Basically:
$headers = 
"From: My Name < info...@domain.com >
Reply-To: in...@domain.com 
Return-Path: in...@domain.com";

NOTE: as noted by Catterbutts
don't save info...@domain.com among your "
'Send As..." Accounts
Re: PHP Reply-To Header Not Recognised?? ChrisG_UK 7/14/10 12:23 AM
The workaround posted by bayxsonic works. Actually, it is enough just to place a single + sign after the from address. So just change your from address from "myad...@gmail.com" to "myadd...@gmail.com", and replying now works as it should.

It's still a bug and it's annoying that there has been no response from Google on this. But at least this is a decent workaround.
Re: PHP Reply-To Header Not Recognised?? Vedavrat 8/23/10 12:45 PM
ChrisG_UK , thank you very much! 
With '+' it started to work.
Re: PHP Reply-To Header Not Recognised?? 3xcept1on 11/1/10 6:47 PM
bayxsonic's solution doesn't work with Google Apps Professional :(
Re: PHP Reply-To Header Not Recognised?? KeithR 11/1/10 7:35 PM
@3xcept1on, please post a sample of the headers in a typical message.  Use Gmail's option "Show original" to see them.  See posts above for an example of what is needed.
Re: PHP Reply-To Header Not Recognised?? vinaay 11/6/10 8:31 AM
@3xcept1on I also faced same issue as yours and bayxsonic's solution didn't worked for me. I have been able to solve it using only CC header. I am not using To header et all.

Hope this helps
Re: PHP Reply-To Header Not Recognised?? bfred.it 12/3/10 2:15 PM
This is not a bug, it's a feature! Meaning: it's not going to get fixed because it's not broken.
I finally figured out why this happens.

When you receive an email from X and you reply to him, his address will go into the TO field. So far so good.
Once you send it, click reply on the email YOU sent. As you see you're not replying to the sender of the selected email (you) but to X, because Google recognizes you don't want to reply to yourself, but to X.

Well, this behavior conflicts with what we're trying to achieve here. When you click on Reply, Google sees that the FROM address is yours, so it uses the TO field, which in this case it's still your address instead of Reply-to, because even if that's different, Google thinks YOU are the sender of that email, not the user via a form.

So, guys, use the method I explained before.
More topics »