简体   繁体   English

Google App脚本GMailApp发送电子邮件并将其分组为“对话”

[英]Google App Script GMailApp send email and group them in Conversation

I'm quite new to Google App Script and playing around with GmailApp.sendEmail. 我刚接触Google App脚本,现在还玩GmailApp.sendEmail。 When I try to send several Email with the same subjects, how can I make them grouped in one single Conversation (given that the Gmail of receiver has Conversation option turn on). 当我尝试发送多个主题相同的电子邮件时,如何将它们分组为一个会话(假设收件人的Gmail的“会话”选项已打开)。

Many thanks, Minh 非常感谢Minh

Since you're using GmailApp , take a look at the Gmail Thread Class . 由于您使用的是GmailApp ,因此请查看Gmail线程类 If you use thread.replyAll(body, options) to respond to the first message you sent, the second message will appear in the same thread in the receiver's mailbox. 如果使用thread.replyAll(body, options)响应发送的第一条消息,则第二条消息将出现在收件人邮箱的同一线程中。

When sending the first message, you would need to cc yourself for it to end up in your own inbox, then you could use [GmailApp.search()][2] to find the threads with messages matching the one you sent. 发送第一条消息时,您需要先进行抄送,才能使其最终出现在您自己的收件箱中,然后可以使用[GmailApp.search()][2]查找包含与您发送的消息匹配的消息的线程。 From there, drill down to the thread, and replyAll . 从那里开始,深入到该线程,然后replyAll

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM