I'm using Google Spreadsheet for customers to send in comments. When they submit a comment, it gets emailed to me. I use the MailApp.sendEmail method. It works as expected except for the replyTo "advanced argument":
var myAdvancedArgs = { htmlBody: myHtmlBody, replyTo: customerEmail };
MailApp.sendEmail("[email protected]", "Comments Form", myBody, myAdvancedArgs);
customerEmail is set properly because I have it output correctly in the body of the message. htmlBody works as I do get the HTML version of the email displaying in my GMail account. However, when I click the reply button in GMail, the To: address is myself. It appears the replyTo
is not being set at all. But then I look in the headers of the email message by clicking the little triangle next to my name with the tooltip "Show Details" and it does mention the correct reply-to address:
reply-to: [email protected]
Is MailApp.sendEmail
not setting the reply-to header correctly?
UPDATE: I've snipped a couple images to demonstrate what's happening. Either the reply-to
header isn't set properly (maybe that's not how you do a reply to?) or GMail is not working properly for me.
First image, you see that there is a reply-to
header created from my Google Spreadsheet script:
Second image, when I click the reply button in GMail, the to address is not filled in with the address in the reply-to
header: