title: Outlook 2010 - C# - Get the account associated to a mail
body: <p>I'm creating an Outlook add-in that can save selected emails to an external database.</p>
  
  <p>Using the <code>Office.IRibbonControl</code> I can get the list of the selected email, but I need to know to which account those mails are associated.</p>
  
  <p>I mean, if Outlook get messages from <code>toto@exemple.com</code> and from <code>otot@exemple.com</code>, when I want to save a message I need to know that information.</p>
  
  <p>I can't use the informations like sender / receiver because it can be an outcome like an income email.</p>
  
  <p>Currently, the only I have found is using the current folder path..</p>
  
  <pre><code>public void SayHello(Office.IRibbonControl control)
  {
      MessageBox.Show(
          "Folder: " + (control.Context as Outlook.Explorer).CurrentFolder.FolderPath,
          "Test",
          MessageBoxButtons.OK,
          MessageBoxIcon.Information);
  }
  </code></pre>
  
  <p>But the method isn't good enough. If I open a message (<em>in a separated window</em>) and then I change the current folder, it fails.</p>
  
  <p>Also, <code>Outlook.Explorer.CurrentAccount</code> does not work as I expected.</p>
  
  <p>So here is my question :
  How can I access the related account having a <code>Outlook.MailItem</code> object ?</p>