let recipient = 'hoge@example.com'; let subject = '件名'; let body = '本文'; let attachmentsFile = DriveApp.getFileById(****************).getBlob(); let options = { 'attachments': attachmentsFile }; let mailId = GmailApp.createDraft(recipient,subject,body,options).getId();
let files = attachmentFolder.getFiles(); let attachmentFiles = new Array() //各ファイルごとにBlob型を取得 while(files.hasNext()){ let file = files.next(); attachmentFiles.push(file.getBlob()); } let options ={ 'attachments': attachmentFiles, }; GmailApp.createDraft(recipient,subject,body,options).getId();