Gmail Message Sory by Size | Arrange Gmail message by Size | Sort your Gmail Messages by Size using Google Docs
The idea is that your Google Docs will connect to your Gmail account and compute the size of every message that’s present in your mailbox. If it finds a bulky message (size > 1 MB), it will make a note of it in the spreadsheet.
Once the sheet has a list of all the bulky message, you can sort the sheet by the Size column to find the big ones. Or use the Filter option (the Funnel icon) to find messages that are within a particular range (5 MB < size < 10 MB). Click the “View” link to open the corresponding message in Gmail, forward it to a secondary email address and delete it from the primary Inbox to recover space.
That’s all the theory you should know, let’s now put this program into action:
The idea is that your Google Docs will connect to your Gmail account and compute the size of every message that’s present in your mailbox. If it finds a bulky message (size > 1 MB), it will make a note of it in the spreadsheet.
Once the sheet has a list of all the bulky message, you can sort the sheet by the Size column to find the big ones. Or use the Filter option (the Funnel icon) to find messages that are within a particular range (5 MB < size < 10 MB). Click the “View” link to open the corresponding message in Gmail, forward it to a secondary email address and delete it from the primary Inbox to recover space.
That’s all the theory you should know, let’s now put this program into action:
- Create a copy of this sheet in your Google Docs account.
- A new Gmail Menu will appear in the sheet after about a minute. Select “Reset Canvas” from the Gmail menu to initialize your sheet.
- Accept the authorization screen and then choose Grant Access to let Google Docs access your Gmail Inbox. This is completely safe because your own Google Docs account is requesting access to your own Gmail account (see source code).
- Once the permissions have been granted, choose “Scan Mailbox” from the Gmail menu to start the scanning process.
Scan Gmail Messages with a trigger
If your Gmail mailbox is large, you can also set up a time-driven trigger to let the script automatically without manual intervention. In this case, you can even close the browser tab and the script will run in the background. Here’s how:- While the Google sheet is open, go to Tools -> Script Editor. On the next screen, choose Resources -> Current Script Triggers.
- Click “Add a New Trigger,” change the Event from “Spreadsheet” to “Time Driven” and set a minutes timer that triggers every 10 minutes.
- Save the trigger, authorize the script if it requires and close the sheet.