如何通过Google Apps脚本发送HTML和TXT电子邮件

时间:2018-12-07 10:15:59

标签: google-apps-script sendmail

我想要并同时在电子邮件中发送正文的txt和html版本。 这样,仅激活txt的用户仍可以阅读文本。

那是来自https://developers.google.com/apps-script/reference/mail/mail-app#sendEmail(String,String,String,Object)的文本邮件正文的示例:

MailApp.sendEmail("recipient@example.com",
                  "replies@example.com",
                  "TPS report status",
                  "What is the status of those TPS reports?");

和来自https://webapps.stackexchange.com/questions/54670/send-html-email-from-a-spreadsheet-using-a-different-alias的htmlBody的示例:

GmailApp.sendEmail(
    'your@emailaddress.com',         // recipient
    'test GmailApp',                 // subject 
    'test', {                        // body
      htmlBody: html                 // advanced options
    }
  );

0 个答案:

没有答案