0
如何使用Gmail API从Apps脚本发送电子邮件,该API从驱动器中提取文件并作为附件包含在邮件中。附带附件的Gmail API
我查看了official documentation,但无法使其正常工作。
如何使用Gmail API从Apps脚本发送电子邮件,该API从驱动器中提取文件并作为附件包含在邮件中。附带附件的Gmail API
我查看了official documentation,但无法使其正常工作。
您可以在不使用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'
});