使用javascript阅读Outlook电子邮件/内容 [英] Reading outlook emails / contents using javascript
本文介绍了使用javascript阅读Outlook电子邮件/内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我对此有一些疑问
https://www.codeproject.com/Tips/863192/Reading-Outlook-Emails-Contents-using-JavaScript
strURL =http://server/page/sample.aspx
我不知道什么是这样做的目的
我想知道我是否使用Chrome浏览我写的页面,我可以在javscript中使用ActiveXObject吗?
谢谢!
我的尝试:
I've some question about this
https://www.codeproject.com/Tips/863192/Reading-Outlook-Emails-Contents-using-JavaScript
strURL = "http://server/page/sample.aspx"
I don't know about what is the purpose to do this
and I want to know if I use Chrome to browse the page which I wrote, can I use "ActiveXObject" in javscript?
thanks!
What I have tried:
<script>
function PopulateTable()
{
var objOutlook = new ActiveXObject("Outlook.Application");
var session = objOutlook.Session;
for(var folderCount = 1;folderCount <= session.Folders.Count; folderCount++)
{
var folder = session.Folders.Item(folderCount);
if(folder.Name.indexOf("Mailbox - ")>=0)
{
for(var subFolCount = 1; subFolCount <= folder.Folders.Count; subFolCount++)
{
var sampleFolder = folder.Folders.Item(subFolCount);
if(sampleFolder.Name.indexOf("Sample")>=0)
{
for(var itmCount = 1; itmCount <= sampleFolder.Items.Count; itmCount++)
{
var itm = sampleFolder.Items.Item(itmCount);
if(!itm.UnRead)
continue;
var sentBy = itm.SenderName;
var sentDate = itm.SentOn;
var receivedBy = itm.ReceivedByName;
var receivedDate = itm.ReceivedTime;
var subject = itm.ConversationTopic;
var contents = itm.Body;
var tbl = document.getElementById('tblContents');
if(tbl)
{
var tr = tbl.insertRow(tbl.rows.length);
if(tbl.rows.length%2 != 0)
tr.className = "alt";
var tdsentBy = tr.insertCell(0);
var tdsentDate = tr.insertCell(1);
var tdreceivedBy = tr.insertCell(2);
var tdreceivedDate = tr.insertCell(3);
var tdsubject = tr.insertCell(4);
var tdcontents = tr.insertCell(5);
tdsentBy.innerHTML = sentBy;
tdsentDate.innerHTML = sentDate;
tdreceivedBy.innerHTML = receivedBy;
tdreceivedDate.innerHTML = receivedDate;
tdsubject.innerHTML = subject;
tdcontents.innerHTML = contents;
}
itm.UnRead = false;
}
break;
}
}
break;
}
}
return;
}
</script>
<div id="divResult">
<input type="button" value="Read" onclick="PopulateTable();" /><br />
<table cellpadding="3" cellspacing="3" border="1" id="tblContents" >
<tr>
<th style="width:100px;">Sent By</th>
<th style="width:80px;">Sent on</th>
<th style="width:80px;">Recived By</th>
<th style="width:75px;">Recived on</th>
<th style="width:75px;">Subject</th>
<th style="width:200px;">Content</th>
</tr>
</table>
</div>
推荐答案
请在文章末尾的论坛中发帖提问,这样作者该文章可以帮助你。
Please post your question in the forum at the end of the article, so the writer of the article can help you.
这篇关于使用javascript阅读Outlook电子邮件/内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文