我正在关注这篇文章,从保持相同颜色和格式的电子表格创建图像,以作为电子邮件发送。
现在,当我尝试以“cc”或“bcc”的形式发送电子邮件时,我收到一条错误消息,上面写着“无效的电子邮件:[L;@34c5bdeb(第 34 行,文件“发送电子邮件”)”。我正在使用的所有电子邮件都可以正常工作,以逗号分隔且没有任何符号。如果我使用与“收件人”相同的电子邮件,它们会很好用;我不知道错误可能是什么。
var image = SheetConverter.convertRange2html(rng);
var HTML = "Team," +
"<br/><br/>Below you will find the summary for the Overview of the Billing files." +
"<br/><br/>" + msg +
"<br/><br/>" + image +
"<br/><br/>Best regards,";
return HTML;
}
function doGet() {
var ss = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('ALERTS');
var EmailSettings = ss.getRange('E5:E9').getValues(); // getting information for the email to be sent
var EmTo = EmailSettings[0];
var emailcc = EmailSettings[1];
var emailbcc = EmailSettings[2];
var EmSubject = EmailSettings[3];
var EmMessage = EmailSettings[4];
var dataRange = ss.getRange('A1:B22'); //Range to be converted into an image
var HTML = convSheetAndEmail(dataRange, EmMessage);
var options = {
name: "TEST EMAIL GROUP",
htmlBody: HTML,
cc:emailcc,
bcc:emailbcc
};
Email(EmTo, EmSubject, options);
}
function Email(email, subject, options) {
MailApp.sendEmail(email, subject, '', options);
}