我正在使用Exchange Server 2007 SP3
我可以使用以下代码连接交换网络服务
ExchangeServiceBinding esb = new ExchangeServiceBinding();
esb.RequestServerVersionValue = new RequestServerVersion();
esb.RequestServerVersionValue.Version = ExchangeVersionType.Exchange2007_SP1;
esb.Credentials = new NetworkCredential("<user_id>", "<password>", "<domain>");
esb.Url = @"https://<server_fqdn>/ews/Exchange.asmx";
我正在寻找下载未读附件的代码。
你能帮帮我吗?答案 0 :(得分:5)
我发现了这个:
private static void ProcessItems(ExchangeService exchangeService)
{
var offset = 0;
const int pageSize = 100;
FindItemsResults<Item> result;
do
{
var view = new ItemView(pageSize, offset)
{
SearchFilter = new SearchFilter.IsEqualTo(EmailMessageSchema.IsRead, false)
};
result = exchangeService.FindItems(WellKnownFolderName.Inbox, view);
foreach (var item in result)
{
ProcessItem(item);
}
offset += pageSize;
} while (result.MoreAvailable);
}
然后从方法ProcessItem
你做任何你想做的事情,如下载附件等等......
来源:Processing items in an Exchange folder using EWS Managed API