我想使用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]'
});
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句