Last active
November 13, 2016 14:39
-
-
Save bultas/969dea2b3afabc70886c0a10d6531bee to your computer and use it in GitHub Desktop.
Gmail - Google Apps Script - permanently delete all messages from specific sender
This file contains hidden or 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
function myFunction() { | |
var senderEmail = "[email protected]"; | |
var threads = GmailApp.search("from:"+senderEmail); | |
for (var i = 0; i < threads.length; i++) { | |
Gmail.Users.Messages.remove('me', threads[i].getId()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment