Skip to content

Instantly share code, notes, and snippets.

Avatar

ginoliang1130 ginoliang1130

  • Taiwan
View GitHub Profile
@ginoliang1130
ginoliang1130 / batch-delete-gmail-emails.js
Created Aug 30, 2021 — forked from gene1wood/batch-delete-gmail-emails.js
A Google Apps Script script to bulk delete large amounts of email in Gmail while avoiding the error #793 which Gmail encounters normally
View batch-delete-gmail-emails.js
/*
This script, when used with Google Apps Scripts will delete 400 emails and
can be triggered to run every few minutes without user interaction enabling you
to bulk delete email in Gmail without getting the #793 error from Gmail.
Google returns a maximum of 500 threads. This limits to 400 threads in case 500
threads is causing timeouts
Configure the search query in the code below to match the type of emails
you want to delete