我想从gmail发送文件夹中获取具有特定主题的特定邮件,我该如何实现?只是指导我在哪里看待或放些可能有用的代码片段,如果条件比较检索到的已发送邮件与subject_variable之间的关系,则只是基本内容。
我的逻辑算法:
var subject_variable = "specific subject"
[some code to retrieve specific sent mail with subject_variable]
if(retrieved sent mail subject == subject_variable)
return 0;
else execute other part of code I prepared already
答案 0 :(得分:1)
您可以在此处指定主题或标签等参数。
示例:
function myFunction() {
var messages = GmailApp.search("in : sent subject : specific subject");
Logger.log("There are " + messages.length + " messages in Sent matching with the specified query.");
}