h1.post-title { color:orange; font-family:verdana,Arial; font-weight:bold; padding-bottom:5px; text-shadow:#64665b 0px 1px 1px; font-size:32px; } -->

Pages

Get Count of Unread mail from Outlook Express in C#.Net

Get Count of Unread mail from Outlook Express in C#.Net

 using Microsoft.Office.Interop.Outlook;  
   public static int CountOfUnreadMails()  
     {  
       Application OutlookApp = new Application();  
       NameSpace myMail = OutlookApp.GetNamespace("MAPI");  
       int unread = myMail.GetDefaultFolder(OlDefaultFolders.olFolderInbox).UnReadItemCount;  
      return  unread;  
      }