SHARE
TWEET

Untitled

a guest Jan 12th, 2017 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // フラグ付きでなく、未読でなく、自分宛てでない、180日より前のメールを削除する
  2. function deleteOldMails() {
  3.   var m = GmailApp.search('-label:starred -label:unread -to:me older_than:180d');
  4.   for (var i = 0; i < m.length; i++) {
  5.     m[i].moveToTrash();
  6.   };
  7. }
RAW Paste Data
Top