Advertisement
Guest User

Auto Archive Gmail <30 Days

a guest
Sep 8th, 2016
728
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. function archiveInbox() {
  2. // Every thread in your Inbox that is read, older than 30 days.
  3. var threads = GmailApp.search('label:inbox is:read older_than:30d');
  4. for (var i = 0; i < threads.length; i++) {
  5. threads[i].moveToArchive();
  6. }
  7. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement