【发布时间】:2021-10-02 22:11:47
【问题描述】:
我尝试编写函数,该函数将删除 Gmail 线程中包含多条消息的消息。
function movetotrash()
{
var thread = GmailApp.getInboxThreads(0,1)[0]; // Get first thread in inbox
if (thread==null)
{}
else
{
var message = thread.getMessages()[0]; // Get the latest message
Logger.log('zero'+thread.getMessages()[0].getPlainBody());
message.moveToTrash()
}
}
我可以看到该消息在 gmail 界面中消失了。 但是当我再次调用这个函数时,我可以看到消息 [0] 是一样的
【问题讨论】:
-
如果你真的想删除它们,为什么不使用 Gmail Rest API