2015-06-11 123 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' 
});