1. I am using Google App Scripts to search and reply to a going emails.
  2. Let's say I can use GmailApp.search to search a thread by subject already and I want to reply to the first search result
  3. I want to reply to: and cc: to specific people every time search and reply this going email. Like: to: [email protected] + cc: [email protected], [email protected]
  4. Now I am using thread[0].replyAll because I don't know how to do as above. But always it reply to all the people of the last message of the going email ( even including me in to the cc or me in the to: if I am the last one doing message of the total email)

    var subjectsearch =brandname+"/ SAMBU"+"/ MATERIAL REQUEST/ ROUND "+round+'/ '+subjectname; var threads = GmailApp.search('subject:('+subjectsearch+')'); if (threads.length>0){ threads[0].replyAll(messagePrefix,{from:"[email protected]",htmlBody: message, })

first message If I replyall it will look like this, I dont want to send to me but always a specific to: and cc: if I want

0 Answers