Google 脚本 - 在邮件应用程序中更改 "From"

GoogleScript - Change "From" in MailApp

我无法访问我们公司的无回复电子邮件地址以使用 GmailApp.sendEmail 作为别名,所以我只能使用 MailApp.sendEmail

我已经更正了回复;但我正在尝试获取电子邮件中的实际 FROM 以显示我的电子邮件地址以外的其他内容,有什么建议吗?

   MailApp.sendEmail(emailAddress, "NO-REPLY@xxxxx.com", subject, message); 

提前致谢。

答案:

您可以指定选项 noReply 以阻止收件人回复电子邮件。但是,您必须以不同的方式调用函数 sendEmailsendEmail(recipient, subject, body, options) 参数 options 是一个 Javascript 选项,看起来像这样:

options = {
  noReply: true
}

但请记住,如果您使用 noReply,则不能指定 replyTo 地址。如果您想提供一个供他们回复,我会在消息中指定。此外,对于以后的情况,我建议您使用 GmailApp 而不是 MailApp,因为它具有更多功能。

参考文献: