0
我需要使用Exchange Web服务API发送邮件,然后检查邮件是否已发送。为此,我尝试使用EWS跟踪,但即使发送的电子邮件不存在,日志文件也会始终给出的NoError状态。 现在我试图在SentItems文件夹中查看最后的消息并检查它们的属性,但我无法找到传递状态的属性。我能用它做什么? 我现在代码:获取邮件传递状态EWS
private void checkDeliveryStatuses(ExchangeService service)
{
ItemView itemview = new ItemView(10);
itemview.PropertySet = new PropertySet(BasePropertySet.IdOnly, EmailMessageSchema.InternetMessageId, *some property for status*);
FindItemsResults<Item> newMessages = service.FindItems(WellKnownFolderName.SentItems, itemview);
foreach (Item item in newMessages)
{
EmailMessage msg = item as EmailMessage;
//Somehow get delivery status here
}
}
非常感谢,但我如何获得ExchangeServiceBinding对象?现在我有命名空间错误。我试图谷歌它,但没有帮助。 –
您需要生成Web服务代理对象,例如在Visual Studio中https://msdn.microsoft.com/zh-cn/library/office/bb408520(v=exchg.140).aspx(与2010年的2010版相同,2015年和2017年) –
再次问候。我得到“访问被拒绝,请检查凭据并重试。”在fmtResponse。凭据是正确的。什么可能是错的? –