在Google Apps脚本MailApp.sendEmail中使用多个抄送和/或密件抄送 [英] Use of multiple cc and/or bcc in google apps script MailApp.sendEmail

查看:170
本文介绍了在Google Apps脚本MailApp.sendEmail中使用多个抄送和/或密件抄送的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我运行程序时,只有boss1@gmail.com被密件抄送.

When I run the program, only boss1@gmail.com gets bcc'ed.

我已经调试了程序,并且正确记录了每个变量.

I've debugged the program and each variable is logged correctly.

MailApp.sendEmail(
    EPEmail, 
    "Internship Opportunity at "+OP,
    emailText,{
        cc:Manager1,
        cc:EPManager2,
        cc:EPManager3,
        bcc:Boss,
        bcc:"boss1@gmail.com"}
);

推荐答案

要求:

发送具有多个抄送/密件抄送地址的电子邮件.

Requirement:

Send emails with multiple cc / bcc addresses.

sendEmail文档的高级参数"部分中:

From the "Advanced parameters" section of sendEmail documentation:

以逗号分隔的发送给抄送的电子邮件地址列表

a comma-separated list of email addresses to CC

这意味着我们可以使用+运算符将变量连接起来并用逗号分隔,以实现您的目标.

This means we can concatenate the variables and separate them with commas using the + operator to achieve your goal.

MailApp.sendEmail(
    EPEmail, 
    "Internship Opportunity at "+OP,
    emailText,{
        cc:Manager1+','+EPManager2+','+EPManager3,
        bcc:Boss+','+"boss1@gmail.com"}
);


参考:


  • Reference:

    • sendEmail(recipient, subject, body, options)
    • 这篇关于在Google Apps脚本MailApp.sendEmail中使用多个抄送和/或密件抄送的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆