Created
January 12, 2017 10:43
-
-
Save kob-to-wni/b5310ab4b1cf21973f943275e4fb77e0 to your computer and use it in GitHub Desktop.
GMailから古い重要でないメールを削除する例
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// フラグ付きでなく、未読でなく、自分宛てでない、180日より前のメールを削除する | |
function deleteOldMails() { | |
var m = GmailApp.search('-label:starred -label:unread -to:me older_than:180d'); | |
for (var i = 0; i < m.length; i++) { | |
m[i].moveToTrash(); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment