I\'m trying to make a script that automatically deletes e-mails from a certain sender immediately and permanently, as Gmail only allows for a filter which sends an e-mail to
function delete_all_mail(){
var myspreadsheet = SpreadsheetApp.openById('1AG1fZ9BuS8***********');
var mysheet = myspreadsheet.getSheets()[0];
//0~500
var threads = GmailApp.getInboxThreads(0 , 500);
for(var i = 0; i < threads.length; i++)
{
threads[i].moveToTrash();
}
}