date - 使用谷歌应用程序脚本阅读特定日期的电子邮件

标签 date google-apps-script gmail

大家好,我正在开发一个项目,我想在特定日期阅读 gmail 收件箱中的电子邮件。我引用了官方documentation但对我来说并没有多大帮助。

var master = SpreadsheetApp.openById(<SPREADSHEET_ID>);
var demosheet = master.getSheetByName("demo");
var newDate = Utilities.formatDate(new Date(), "GMT+5:30", "dd/MM/YYYY");
var getdate = demosheet.getDataRange().getValues();
var firstThread = GmailApp.getInboxThreads(0,1)[0];
//to get date from spreadshet
for(i=2;i<getdate.length;i++)
{
Logger.log(firstThread.getLastMessageDate(getdate[i][0]));  }}

有人可以帮忙吗,先谢谢了。

最佳答案

查看 GmailApp.search。谷歌搜索格式,因为它不在文档中。可能使用语法 'before:x after:y

https://developers.google.com/apps-script/reference/gmail/gmail-app?hl=ja#search(String,Integer,Integer)

关于date - 使用谷歌应用程序脚本阅读特定日期的电子邮件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22862308/

相关文章:

java - 删除月份 SimpleDateFormat 中的前导 "0"

google-apps-script - 如何让其他人安装我的 Google Apps 脚本?

javascript - 使用 MailApp.sendEmail 设置正文电子邮件文本格式的替代方法

javascript - HTMLService/Google Apps 脚本中的日期选择器

oauth - Gmail IMAP,为X个最新事件的Gmail线程搜索最佳方法

javascript - 使用JS和Jquery将 'Month and Year'字符串转换成Date对象

swift - 日期数组到字符串数组 Swift

java - 如何在 java 中使用公历和日期获取一天的开始

c# - 如何在 while 循环中进行 sleep ?

c# - 尝试下载附件的 pop3 问题-C#