title: how to save mail form outlook with attachments?
body: <p>I wanted to save Outlook mails in to msg format along with the attachment through C#.</p>
  
  <p>I tried the following code</p>
  
  <pre><code>using Outlook = Microsoft.Office.Interop.Outlook;
  
  private void button1_Click(object sender, EventArgs e)
  {  
  
  Outlook.Application app = new Microsoft.Office.Interop.Outlook.Application();
  Outlook.NameSpace ns = app.GetNamespace("MAPI");
  Outlook.MAPIFolder inbox = ns.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox);
  
  foreach (Outlook.MailItem item in inbox.Items)
  {
    item.SaveAs(finename, Outlook.OlSaveAsType.olMSG);
  }
  
  }
  </code></pre>
  
  <p>It could save the mail as msg but the attachment part was removed. SaveAs method had no other overloads alos... :(</p>
  
  <p>If i try to save a message from outlook it saves the message along with the attachment embedded in it. Any idea how this can be achieved..?</p>
  
  <p>I am using .Net Framework 3.5 and Outolook 2007</p>