ews-javascript-api查找项目不返回任何内容

时间:2017-03-03 05:32:54

标签: javascript outlook exchangewebservices ewsjavaapi

我正在使用ews-javascript-api连接Outlook Exchange并阅读邮件。

我需要下载附件。

但是,当我运行FindItems查询时,它返回0项。

var ews = require('ews-javascript-api');
var ExchangeService = ews.ExchangeService;
var service = new ExchangeService(ews.ExchangeVersion.Exchange2010);
service.Credentials = new ews.ExchangeCredentials("MY_USERNAME", "MY_PASSWORD");
service.Url = new ews.Uri("https://outlook.office365.com/Ews/Exchange.asmx");

var items = service.FindItems(ews.WellKnownFolderName.Inbox, "hasattachment:true",new ews.ItemView(1));

items.then(function (response)
{
    console.log("__________________________");

    console.log(response);
},function(err){
    console.log("ERROR");
});

我无法理解为什么会这样。是否只收到未读电子邮件?

输出:

 FindItemsResults {
  totalCount: 0,
  nextPageOffset: null,
  moreAvailable: false,
  items: [],
  highlightTerms: [] }

0 个答案:

没有答案