title: Reading e-mail without Outlook app open
body: <p>Thats what I am using to read e-mail using C#:</p>
  
  <pre><code>outLookApp.NewMailEx += new ApplicationEvents_11_NewMailExEventHandler(outLookApp_NewMailEx);
              Outlook.NameSpace olNameSpace = outLookApp.GetNamespace("mapi");
  
  olNameSpace.Logon("xxxx", "xxxxx", false, true);
  Outlook.MAPIFolder oInbox  = olNameSpace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox);
  Outlook.Items oItems  = oInbox.Items;
  MessageBox.Show("Total : " + oItems.Count); //Total Itemin inbox
   oItems = oItems.Restrict("[Unread] = true");
   MessageBox.Show("Total Unread : " + oItems.Count); //Unread Items
   Outlook.MailItem oMsg;
  
  
   Outlook.Attachment mailAttachement;
   for (int i = 0; i &lt; oItems.Count; i++)
   {
       oMsg = (Outlook.MailItem)oItems.GetFirst();
  
       MessageBox.Show(i.ToString());
  
      MessageBox.Show(oMsg.SenderName);
      MessageBox.Show(oMsg.Subject);
      MessageBox.Show(oMsg.ReceivedTime.ToString());
      MessageBox.Show(oMsg.Body);
  </code></pre>
  
  <p>The problem that I am facing is this application only works if the Outlook is open on the machine. If Outlook is closed it throws an exception:</p>
  
  <blockquote>
    <p>The server is not available. Contact your administrator if this condition persists.</p>
  </blockquote>
  
  <p>Is there anyway I can read e-mail with Outlook open?</p>