2015-06-11 161 views

回答

1

您可以在不使用GMail API的情況下使用GmailApp服務來完成此操作。實際上,您的用例是GmailApp.sendEmail()文檔中提供的示例。

// Send an email with a file from Google Drive attached as a PDF. 
var file = DriveApp.getFileById('1234567890abcdefghijklmnopqrstuvwxyz'); 
GmailApp.sendEmail('[email protected]', 'Attachment example', 'Please see the attached file.', { 
    attachments: [file.getAs(MimeType.PDF)], 
    name: 'Automatic Emailer Script' 
});