gpt4 book ai didi

email - Google Apps 脚本 - MailApp

转载 作者:行者123 更新时间:2023-12-01 12:20:07 29 4
gpt4 key购买 nike

我想使用 Google Apps 脚本发送一封包含replyTo 和附件的电子邮件,但我只找到了这两种方法,它们分别执行我想要的操作。

sendEmail(recipient, subject, body, options)

sendEmail(to, replyTo, subject, body)

还有另一种方法可以同时实现这两种方法吗?

最佳答案

你最好的选择是使用第一种方法

sendEmail(recipient, subject, body, options)

此方法可以获取您的所有参数。您在选项部分传递所有参数。

它看起来像这样。

// Send an email with two attachments:
// a file from Google Drive (as a PDF) and an HTML file.
var file = DriveApp.getFileById('12345mnopqrstuvwxyz');
var blob = Utilities.newBlob('HTML content here',
'text/html',
'my_email.html');

MailApp.sendEmail('<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d0bdb9bbb590b5a8b1bda0bcb5feb3bfbd" rel="noreferrer noopener nofollow">[email protected]</a>',
'Attachment example',
'Two files are attached.',
{
attachments: [file.getAs(MimeType.PDF), blob],
replyTo: '<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="633106130f1a370c23260e020a0f4d000c0e" rel="noreferrer noopener nofollow">[email protected]</a>'
});

这是文档的屏幕截图

Google Documentation Image

Google documentation here

关于email - Google Apps 脚本 - MailApp,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45037472/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com