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

问题描述

限时删除!!

当我运行程序时,只有[email protected]被密件抄送.

When I run the program, only [email protected] 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:"[email protected]"}
);

推荐答案

要求:

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

Requirement:

Send emails with multiple cc / bcc addresses.

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

From the "Advanced parameters" section of sendEmail documentation:

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

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+','+"[email protected]"}
);


参考:


  • Reference:

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

      1403页,肝出来的..

09-08 03:16