string variable not being recognized in replyTo argument for sendmail

15 views Asked by At

Everything in this script call to sendEmail works fine, but the replyTo is not being honored. Have printed out the string I want to use and all is correct but the email received doesn't have the correct replyTo. What gives?

GmailApp.sendEmail(row[RECIPIENT_COL], msgObj.subject, msgObj.text, {
      htmlBody: msgObj.html,
      // bcc: '[email protected]',
      // cc: '[email protected]',
      from: '[email protected]',
      name: 'RGNA Steering Committee',
      replyTo: new_reply_to,
      // noReply: true, // if the email should be sent from a generic no-reply email address (not available to gmail.com users)
      attachments: emailTemplate.attachments
    });

new_reply_to string value is correct but is not in the email sent
1

There are 1 answers

0
RGNA Officer On

Using replyTo in the GmailApp.sendEmail will NOT override a reply to that was established in the account settings.

Once I removed it, the script worked fine.