How To Use Google App Scripts To Retrieve Gmail Emails In A Customised Way?
Here's a neat javascript code I wrote to get all emails from my Gmail and put the list of sender name in a google spreadsheet. function doGet() { var myspreadsheet = SpreadsheetA
Solution 1:
Looks like about 10secs /100 messages this way. Can't think of anything faster in GAS.
function getMail(){
var inc = 100;
var start = 0;
do {
var now = new Date();
var thread = GmailApp.getInboxThreads(start, inc);
start += inc;
var messages = GmailApp.getMessagesForThreads(thread);
Logger.log("# threads"+thread.length+"# of messages" + messages.length+" time :"+(new Date()-now));
} while (thread.length == inc);
}
Post a Comment for "How To Use Google App Scripts To Retrieve Gmail Emails In A Customised Way?"