r/GoogleAppsScript • • Mar 16 '26

Question Help with auto replies

Hi there, I have no idea what I’m doing and am looking for some help.

I have a website that clients can fill in a web form that sends to my business gmail address. The email comes from wordpress@mybusinessname but has a “reply-to” field containing the email address that has been filled in by my customer.

I have now discovered that gmail vacation/out-of-office replies ignore the “reply-to” field and cause my automatic replies to bounce back. I have also tried creating a filter with an auto-reply template to try and work around this issue but it has the same problem.

After some googling and much frustration I have figured out that I need a Google apps Script to automatically detect the reply-to address and send to that rather than the From address.

Does anyone have a script they could share? Or point me in the right direction…

Thanks!

5 Upvotes

3 comments sorted by

View all comments

Show parent comment

1

u/mystique0712 Mar 16 '26

How to Automate It (The "Trigger") A script only runs when you tell it to. To make this an "Auto-Responder," you need to set a time trigger:

  1. In the Apps Script editor, click the Triggers icon (the clock shape on the left sidebar).
  2. Click + Add Trigger at the bottom right.
  3. Choose autoReplyWithReplyTo as the function to run.
  4. Select Time-driven as the event source.
  5. Set it to Minutes timer and select Every minute (or every 5-10 minutes depending on how "instant" you need it to be).
  6. Click Save. You will likely need to grant Google permissions to access your Gmail.