I have a problem with the GmailApp search(query) function.
According to the manual it uses Gmail queries, so all the arguments should be accessible and return correct results.
This is my query:
var sent_threads = GmailApp.search('in:sent after:2016/02/29');
Logger.log(sent_threads.length); // This one prints 21
for (var i = 0; i < sent_threads.length; i++) {
var message = sent_threads[i].getMessages()[0];
var recipient = message.getTo();
Logger.log(recipient); // This one prints 21 email recipients
}
But when I go to the Gmail.com and type in the query in search bar I will get 44 messages. Any idea why those results are different?