title: how to cancel sending a message from Outlook and close the form
body: <p>I try to cancel sending the message from Outlook. I need get all fields from mailItem and close it without sending. </p>
  
  <p>in my code i get an error - Unable to execute command Item.Close during the event Item.Send.</p>
  
  <pre><code>public partial class MyMainForm
  {
      Outlook.Application oApp;
      Outlook.MailItem mailItem;
      System.Threading.Timer timer_CloseMail;
  
    private void Mail_in_outlook()
      {
          oApp = new Outlook.Application();
          mailItem = Outlook.MailItem)oApp.CreateItem(Outlook.OlItemType.olMailItem);
  
          TimerCallback tm = new TimerCallback(CloseMail);
          timer_CloseMail = new Timer(tm);
  
          oApp.ItemSend += oApp_ItemSend;
          mailItem.DeleteAfterSubmit = true;
  
          mailItem.Display(true);
  
          // get mailItem.HTMLBody and other field....
  
      }
  
  void oApp_ItemSend(object Item,ref bool Cancel)
      {
          Cancel = true;
          MailtimeTimer.Change(0, 0);
      }
  
  private void CloseMail(object sender)
      {
          mailItem.Close(Outlook.OlInspectorClose.olDiscard);
      }
  </code></pre>