我想使用 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('[email protected]',
'Attachment example',
'Two files are attached.',
{
attachments: [file.getAs(MimeType.PDF), blob],
replyTo: '[email protected]'
});
这是文档的屏幕截图
谷歌文档在这里
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)