【发布时间】:2020-10-01 01:47:18
【问题描述】:
我目前正在尝试使用 Google Apps 脚本将 Google 表格作为电子邮件附件发送。当我执行代码(如下所示)时,它会自动将其作为 PDF 发送,即使我没有指定我想以这种格式发送。
有没有办法以 Google 表格格式发送附件?
function emailGoogleSheet()
{
try
{
// Get file from Google Drive
var googleSheet = DriveApp.getFileById("xxxxxxxxxxxxxxxx")
// Send email with file attached
MailApp.sendEmail("name@email.co.uk", "Report", "Please see the attached report.", {attachments: googleSheet})
}
catch (exception)
{
Logger.log(exception);
}
}
【问题讨论】:
标签: google-apps-script google-drive-api gmail-api