title: Outlook Interop, Mail Formatting
body: <p>I have an application written in C# that uses Outlook Interop to open a new mail message pre-filled with details the user can edit before manually sending it.</p>
  
  <pre><code>var newMail = (Outlook.MailItem)outlookApplication.CreateItem(
      Outlook.OlItemType.olMailItem);
  newMail.To = "example@exam.ple";
  newMail.Subject = "Example";
  newMail.BodyFormat = Outlook.OlBodyFormat.olFormatHTML;
  newMail.HTMLBody = "&lt;p&gt;Dear Example,&lt;/p&gt;&lt;p&gt;Example example.&lt;/p&gt;";
  newMail.Display(false);
  </code></pre>
  
  <p>When the same user creates a new message manually the font is set to <em>Calibri</em> or whichever font the user has set as their default.  The problem is that the text in the automatic email appears in <em>Times New Roman</em> font which we do not want.</p>
  
  <p>If I view source of one of the delivered emails I can see that Outlook has explicitly set the font in the email source:</p>
  
  <pre><code>// Automated
  p.MsoNormal, li.MsoNormal, div.MsoNormal
  {
      margin:0cm;
      margin-bottom:.0001pt;
      font-size:12.0pt;
      font-family:"Times New Roman";
  }
  
  // Manual
  p.MsoNormal, li.MsoNormal, div.MsoNormal
  {
      margin:0cm;
      margin-bottom:.0001pt;
      font-size:11.0pt;
      font-family:"Calibri","sans-serif";
  }
  </code></pre>
  
  <p>Why are the formats different and how can I get the automated email to use the users default settings?  I am using version 11 of the interop assemblies as there is a mix of Outlook 2003 and 2007 installed.</p>