【发布时间】:2017-03-31 07:17:49
【问题描述】:
我想使用 google docs 文件的内容从电子表格发送电子邮件作为消息(电子邮件正文)。这就是我现在所拥有的,效果很好。
*部分代码
var doc = DocumentApp.openById(row[9]);
var message = doc.getText();
MailApp.sendEmail(emailAddress, subject, "Dear " + row[6] +"\n\n"+ message + "\n\n"+ row[1] + "\n" + row[2] + "\n" + row[3] + "\n" + row[4]);
它工作得很好,但电子邮件是纯文本。
我有一点格式,例如血色/彩色/列表格式……等等。 如何在电子邮件中保留这些格式?
我尝试了 getBody() 或 getParagraph(),但它只返回“文档”或“段落、段落、段落”。
提前致谢!
*仅供参考 我试过这个。 How to send rich text emails with GmailApp? 效果不错,但我正在尝试找到一种解决方案,将富文本直接用于电子邮件。无法使用 html 格式解决。
【问题讨论】:
标签: email google-apps-script google-docs