SendEmail 脚本 Google 个电子表格 - 多个选项

SendEmail script Google spreadsheets - multiple options

我正在尝试从 google 个包含多个选项的电子表格发送电子邮件:

如果我先在代码中键入附件,然后键入 htlmBody,如下所示,电子邮件将以正确的正文内容和结构发出,但不会出现这两个附件

MailApp.sendEmail(recipient, subject,{attachments:[blob,blob1]} ,{htmlBody:html});

虽然如果我在代码中先键入 htmlBody,然后键入附件,如下所示,电子邮件将以正文“[object Object]”发出,但存在两个附件!

MailApp.sendEmail(recipient, subject ,{htmlBody:html},{attachments:[blob,blob1]});

我做错了什么?为什么我不能同时使用两者?如果我需要添加 "cc" 选项?

我已经尝试过只使用一个附件,结果是一样的!

https://developers.google.com/apps-script/reference/gmail/gmail-app#sendEmail(String,String,String,Object)

GmailApp.sendEmail(recipient, subject , 'body if no html', {
     htmlBody:html, attachments: [blob,blob1]
 });

如果您知道他们有 HTML,您可以将没有 HTML 的正文替换为空字符串,但占位符和空字符串必须存在。

GmailApp.sendEmail(recipient, subject , '', {
         htmlBody:html, attachments: [blob,blob1]
     });