I\'m looking at my inbox and I can see the time of the email is being recorded, but I\'m having trouble seeing how to grab the date/time of an email, despite looking at
How about a following sample? You can retrieve date for each e-mail using getDate()
. The sample script is as follows.
var threads = GmailApp.getInboxThreads(0, 50);
threads.forEach(function(messages){
messages.getMessages().forEach(function(msg){
var date = msg.getDate(); // date/time
var body = msg.getBody(); // mail
Logger.log(date)
Logger.log(body)
});
});
getDate()
is heregetInboxThreads()
is hereIf I misunderstand your question, I'm sorry.