本文介紹了使用 Google 腳本從 Google Drive 發(fā)送多個(gè)附件的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!
問(wèn)題描述
您好,我正在嘗試通過(guò)腳本從我的谷歌驅(qū)動(dòng)器發(fā)送多個(gè)圖像,但代碼似乎不起作用.我怎樣才能做到這一點(diǎn)?
Hi I am trying to send multiple images from my google drive via a script but the code does not seem to work. How can I achieve this?
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()]
})
}
推薦答案
終于拿到了 Google App Script editor.這個(gè)變種確實(shí)有效,并向我發(fā)送帶有兩個(gè)附件的電子郵件
Finally got my hands to Google App Script editor. This variant defenitly worked and send me email with two 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()
只需確保您的 Google 云端硬盤中存在無(wú)標(biāo)題文檔"和128x128_tl_icon.png"文件即可.它認(rèn)為這是你的問(wèn)題
Just make sure that files 'Untitled document' and '128x128_tl_icon.png' exists on your Google Drive. It think this is your problem
這篇關(guān)于使用 Google 腳本從 Google Drive 發(fā)送多個(gè)附件的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!
【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!