Google apps script 如何在通过谷歌应用程序脚本发送时更改链接颜色
我在谷歌应用程序脚本中使用GmailApp发送电子邮件 sendmail(“,EMAIL_TITLE,”,{'cc':cc,htmlBody:newMsg}) htmlBody是在code.gs中编写的,它是一个简单的代码。它仅显示链接列表: str+=“Google apps script 如何在通过谷歌应用程序脚本发送时更改链接颜色,google-apps-script,Google Apps Script,我在谷歌应用程序脚本中使用GmailApp发送电子邮件 sendmail(“,EMAIL_TITLE,”,{'cc':cc,htmlBody:newMsg}) htmlBody是在code.gs中编写的,它是一个简单的代码。它仅显示链接列表: str+=“”+strTitle+“\n” 因为我想强调一些更重要的环节。我尝试使用if语句更改样式(例如链接颜色或背景颜色) 但是,以下各项都不起作用。它说代码有一个缺失的语句错误。如果从链接的html中删除style=“…”,则代码将起作用 1.)st
function testmailHTML(){
var strTitle = 'go to this test'
var newMsg = "<a href='www.google.com' style=color:red /a>" + strTitle ;
GmailApp.sendEmail("xxxxx@gmail.com",'EMAIL_TITLE', "", {htmlBody: newMsg });
}
函数testmailHTML(){
var strTitle='进行此测试'
var newMsg=“”+strttle;
GmailApp.sendmail(“xxxxx@gmail.com“,'EMAIL_TITLE',”,{htmlBody:newMsg});
}
结果如下:
非常感谢。它起作用了!我有红色的链接<仅供参考。我还尝试了var newMsg=“”+strTitle;它将在gmail中提供黑色链接。