2015-10-06 36 views
1

我正在開發一個示例c#應用程序,用於監視通過組織交換服務器的所有會議請求。我曾嘗試使用EWS特定電子郵件地址讀取所有郵件,如何閱讀所有通過組織交換服務器的會議請求

MailServer oServer = new MailServer("outlook.office365.com", 
         "[email protected]", "testpassword", ServerProtocol.ExchangeEWS); 
      MailClient oClient = new MailClient("TryIt"); 

      // If your POP3 server requires SSL connection, 
      // Please add the following codes: 
      // oServer.SSLConnection = true; 

      try 
      { 
       oClient.Connect(oServer); 
       MailInfo[] infos = oClient.GetMailInfos(); 
       for (int i = 0; i < infos.Length; i++) 
       { 
        MailInfo info = infos[i]; 
        Console.WriteLine("Index: {0}; Size: {1}; UIDL: {2}", 
         info.Index, info.Size, info.UIDL); 

        // Receive email from mail server 
        Mail oMail = oClient.GetMail(info); 

        Console.WriteLine("From: {0}", oMail.From.ToString()); 
        Console.WriteLine("Subject: {0}\r\n", oMail.Subject); 
       }...... 

,但上面的代碼只能從特定的郵箱地址讀取郵件。我需要閱讀所有通過特定組織交換服務器的會議請求(例如:表單contoso.com域) EWS是可能的,還是有其他解決方案可用。

任何幫助表示讚賞。

+0

請問您提供使用EWS的代碼?它似乎不是。這段代碼如何與你的問題相關?在您提供的代碼中連接到POP3服務器。 EWS僅適用於Exchange服務器。 –

+0

發佈更新...當前我正在使用此代碼段閱讀收件箱郵件中的特定郵件地址。是否有任何其他解決方案可以從組織郵件服務器讀取所有郵件(主要是會議請求)(而不是在組織域中提供單一用戶郵件地址)。 – Cyber

+0

您正在使用的API的名稱是什麼? –

回答

0

我建議您考慮使用傳輸代理https://msdn.microsoft.com/en-us/library/office/bb204097(v=exchg.150).aspx,傳輸代理將允許您在傳輸管道中處理會議邀請。然後您應該可以使用TN閱讀器使用專業閱讀器https://msdn.microsoft.com/en-us/library/office/microsoft.exchange.data.contenttypes.icalendar(v=exchg.150).aspx或解析消息上的TNEF屬性。有一個樣品的iCalendar劑http://blogs.technet.com/b/jasoning/archive/2011/08/17/icalendar-property-rewrite.aspx

乾杯 格倫

相關問題