0
我想通過C#中的Exchange API接收郵件,我可以獲取我的帳戶的信息,但不是爲其他幾個帳戶。我得到這個錯誤:c#交換web服務不適用於特定的郵件地址
從服務接收的響應不包含有效的XML
這裏是代碼:
public void run()
{
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2007_SP1);
service.Credentials = new NetworkCredential(@"xxx", @"xxx","xxx");
service.Url = new Uri("https://www.myserver.fr/ews/exchange.asmx");
PropertySet itemPropertySet = new PropertySet(BasePropertySet.FirstClassProperties);
ItemView view = new ItemView(int.MaxValue);
view.PropertySet = itemPropertySet;
SearchFilter filter = new SearchFilter.IsGreaterThanOrEqualTo(ItemSchema.DateTimeReceived, DateTime.Now.AddMinutes(-120));
FindItemsResults<Item> results = service.FindItems(WellKnownFolderName.Inbox, filter, view);
foreach (EmailMessage item in results)
{
Debug.WriteLine(item.Subject);
}
}
static bool RedirectionCallback(string url)
{
// Return true if the URL is an HTTPS URL.
return url.ToLower().StartsWith("https://");
}
感謝您的關注
編輯:
從srvice收到的XML字符串:
--ErrorL'autorit德scurit區域東北peut考績TRE contacte
翻譯:無法聯繫本地安全autority
所以我相信,我可以聯繫管理員信箱(像我的),而不是正常的用戶盒...所以我可以在我的Exchange服務器做什麼來改變它?
我建議你啓用跟蹤https://msdn.microsoft.com/en-us/library/office/dn495632%28v=exchg.150%29.aspx?f=255&MSPPError=-2147217396。錯誤的意思是它的意思,但你必須看看實際的反應,如追蹤或使用提琴手,看看有什麼在響應,應該告訴你可能發生的事情 –
得到它!我將用結果編輯我的問題 – alexay68