Quantcast
Channel: Active questions tagged email - Stack Overflow
Viewing all articles
Browse latest Browse all 29769

Google Apps Script: How to set headers with GmailApp.sendMail() or GmailApp.createDraft() [duplicate]

$
0
0

I'm trying to write a function that sends reminders to all who don't replied within a few days.

The problem is: createDraftReply() and reply() will set recipient to my own mail address because the docs say:

Reply to the sender of the last message on this thread using the replyTo address.

The last message, which should be replied to, is from me of course. The reply button in the gmail web interface sets the recipient "correct". In this case to the recipient from the last mail. I saw no way to do this with the provided Apps Script methods.

The next idea was to create a draft and then update() it with the "correct" recipient. Unfortunately this breaks the reference to the original message. After analyzing was is going wrong I found out that after updating the drafts recipient the mail headers References: and In-Reply-To: disappear.

How can I set this headers to accomplish my goal?


Viewing all articles
Browse latest Browse all 29769

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>