Search code examples
google-app-enginegmailgoogle-apps

Does GmailApp.getInboxThreads() get "Archive" emails too?


I have a quick question though, if I use var threads = GmailApp.getInboxThreads(); in conjunction with threads[i].moveToTrash(); will that delete "Archive" emails as well? or will it skip over them?


Solution

  • var threads = GmailApp.getInboxThreads();
    

    The above code ignores any Archived messages because Archived messages are not actually still in the Inbox.