Email a group and not individual addresses with Google App Script

我的梦境 提交于 2019-12-02 04:45:30

You need to get the email address to an array first. Use the contacts app to get the Test group and then loop through all the contacts to get their addresses.

var emails = []; 
var contacts = ContactsApp.getContactGroup('Test').getContacts();
 for(var i in contacts){
    emails.push(contacts[i].getPrimaryEmail());
   }

Then use the emails variable in the send to or bcc parameter as Cooper suggested.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!