title: C# how change Sender field in outlook
body: <p>How can I change form "to", when i create a new mail (or reply) in outlook?
  mailItem.Sender and SendUsingAccount don't work.</p>
  
  <p>namespace OutlookAddIn7
  {
      public partial class ThisAddIn
      {
       Outlook.Inspectors inspectors;</p>
  
  <pre><code>    private void ThisAddIn_Startup(object sender, System.EventArgs e)
      {
  
          inspectors = this.Application.Inspectors;
          inspectors.NewInspector +=
          new Microsoft.Office.Interop.Outlook.InspectorsEvents_NewInspectorEventHandler(SendUsingAccountExample);
  
      }
      void SendUsingAccountExample(Microsoft.Office.Interop.Outlook.Inspector Inspector)
      {
          Outlook.MailItem mailItem = Inspector.CurrentItem as Outlook.MailItem;
          Outlook.NameSpace session = mailItem.Session;
          Outlook.Accounts accounts = session.Accounts;
          mailItem.SendUsingAccount = Application.Session.Accounts[1];
              //mailItem.Sender = accounts[1].CurrentUser.AddressEntry;
              //Microsoft.Office.Interop.Outlook.Recipient recipient = Application.Session.CreateRecipient(accounts[1].CurrentUser.AddressEntry.Address);
      }
  </code></pre>