Google Apps脚本-MailApp

阿玛德夫

我想使用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]'
                  });

这是文档的屏幕截图

Google文档图片

此处的Google文档

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

使用mailApp发送htmlbody的Google Apps脚本(正在修改内容)

Google 表格脚本 MailApp.sendEmail 提示

MailApp Google Script Html 模板脚本

Google Apps脚本:使用mailapp.sendmail服务发送仅带有偶尔附件的邮件

在Google Apps脚本MailApp.sendEmail中使用cc和/或bcc

Google脚本:MailApp.sendEmail到多个地址?

如何使用MailApp Google App脚本修改字体

防止使用MailApp.sendEmail Google表格换行?谷歌脚本

Google Apps脚本:MailApp.sendEmail()除了TEXT和HTML文件外什么也不能发送,别无其他?

使用Google Apps脚本(MailApp.sendEmail)设置正文电子邮件文本格式的替代方法

增加个人帐户的 Google Apps Script MailApp 电子邮件限制

如何在 Google Apps Script 中使用 MailApp 附加計算的 CSV

使用MailApp.sendEmail脚本用Google工作表字段填充HTML正文

Google应用脚本-如何创建具有多张表格的Excel文件并附加到MailApp?

Google Apps脚本要求

调用Google Apps脚本

Google Apps 脚本 indexOf

Google Apps脚本:onEdit

电子邮件内容显示在电子邮件预览中,但不显示在邮件本身中-Google Apps Script MailApp

如何强制Google App脚本MailApp.sendEmail对循环中的每个电子邮件使用新线程?

mailapp 脚本中的可点击链接

Apps 脚本不使用 MailApp.sendEmail() 发送电子邮件

Google Apps 脚本 HTML 表单

Google Apps脚本错误值

Google Apps脚本上的附件

删除google-apps脚本

Google Apps 脚本 - 循环日期

Google Apps脚本返回null

从Google Apps脚本启动下载