你好我想通过一个脚本从我的谷歌驱动器发送多个图片,但该代码似乎并没有工作。 我怎样才能做到这一点?
function sendEmail() {
var Rainfall = DriveApp.getFilesByName('beach.jpg')
var High = DriveApp.getFilesByName('High.png')
MailApp.sendEmail({
to:"example@google.com",
subject: "Images for Social Media",
body:"Hi Joe, here are the images for Social Media",
attachments: [Rainfall.next(),High.next()]
})
}
终于得到了我的手到谷歌应用程序脚本编辑器。 这种变异defenitly工作,给我两个attacments电子邮件
function sendEmail() {
var Rainfall = DriveApp.getFilesByName('Untitled document')
var Rainfall2 = DriveApp.getFilesByName('128x128_tl_icon.png')
MailApp.sendEmail({
to:"mymail@gmail.com",
subject: "Images for Social Media",
body:"Hi Joe, here are the images for Social Media",
attachments: [Rainfall.next(), Rainfall2.next()]
})
}
sendEmail()
只要确保文件的无标题文档“和”128x128_tl_icon.png在您的谷歌驱动器存在。 它认为这是你的问题