Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/387.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在谷歌应用程序脚本gui中显示gmail消息_Javascript_Google Apps Script_Gmail_Google Apps - Fatal编程技术网

Javascript 在谷歌应用程序脚本gui中显示gmail消息

Javascript 在谷歌应用程序脚本gui中显示gmail消息,javascript,google-apps-script,gmail,google-apps,Javascript,Google Apps Script,Gmail,Google Apps,在谷歌应用程序脚本web应用程序中显示gmail消息内容的最佳方式是什么? 下面是我的邮件原始html的示例: message.getBody(); <div><em><strong><u>TEST</u></strong></em></div> message.getBody(); 测试 因此,问题实际上是如何在某个窗口或弹出窗口中显示原始html,我认为您要查找的是允许您在应用程序脚本中创建

在谷歌应用程序脚本web应用程序中显示gmail消息内容的最佳方式是什么? 下面是我的邮件原始html的示例:

message.getBody();

<div><em><strong><u>TEST</u></strong></em></div>
message.getBody();
测试

因此,问题实际上是如何在某个窗口或弹出窗口中显示原始html,我认为您要查找的是允许您在应用程序脚本中创建基本html文件的

脚本,例如:

function myFunction() {
var threads = GmailApp.getInboxThreads();
var messages = threads[0].getMessages()[0];
var raw = messages.getPlainBody();
return raw;
}

function doGet() {
   var raw = myFunction();
   return HtmlService.createHtmlOutput('<b><p>'+ raw + '</p></b>');
 }
函数myFunction(){
var threads=GmailApp.getInboxThreads();
var messages=threads[0].getMessages()[0];
var raw=messages.getPlainBody();
返回原材料;
}
函数doGet(){
var raw=myFunction();
返回HtmlService.createHtmlOutput(“”+raw+”

”); }
将允许您创建一个HTML文件,其中包含用户每次访问网站时最后一封电子邮件的内容


我上面的示例非常基本,但您可以整理它以显示您想要的内容

对不起,不清楚你所说的“最佳方式”是什么意思。你的要求是什么?你目前是如何做到这一点的?你是否遇到了障碍?唯一的要求是——以某种方式显示来自原始内容的消息