我每天都收到多封自动邮件。一个是“每日报道”,另一个是“每日报道细节”。这是我使用的脚本,但一旦电子邮件没有按时间顺序发送,我有时会发现错误的一封。
var threads = GmailApp.search('Daily Report') //search gmail with the given query(partial name using * as a wildcard to find anything in the current subject name).
var msgs = GmailApp.getMessagesForThreads(threads);有没有办法告诉搜索,我想要邮件的确切主题“每日报告”,而不是与‘每日报告的细节’?
谢谢
发布于 2017-05-26 09:52:36
就像“Pierre-Marie Richard”和“Cooper”提到的那样,您可以使用内置的Gmail搜索功能。下面是Gmail搜索功能的列表,就像库珀提到的那样,您最好使用这样的方法:
var threads = GmailApp.search('subject:"Daily Report"-Details')
var msgs = GmailApp.getMessagesForThreads(threads);引号("")是完全匹配的,减号('-')是用来排除一个单词的。如果这仍然不起作用,让我知道,我会进一步调查。
好运:)
https://stackoverflow.com/questions/44174943
复制相似问题