title: How do I popup the compose / create mail dialog using the user's default email client?
body: <p>The use case is simple. At a certain point of time, I need to be able to show the user his familiar compose email dialog (Outlook or other) with </p>
  
  <ul>
  <li>fields like from, to, Subject already filled up with certain application determined values.</li>
  <li>The email would also have an attachment along with it.</li>
  </ul>
  
  <p>The mail should not be sent unless the user explicitly okays it.</p>
  
  <p>I did this once back in the ol' VB6 days.. can't figure out how now.. I just remember that it was quite easy.</p>
  
  <p>Managed app, C#, .net 3.0+</p>
  
  <p><strong>Update#1</strong>: Yeah seems like mailto removed support for attachments (as a security risk?). I tried</p>
  
  <p>You need to include ShellExecute signature <a href="http://pinvoke.net/default.aspx/shell32/ShellExecute.html" rel="noreferrer">as described here</a>. All I got from this was a 5 <code>SE_ERR_ACCESSDENIED</code> and a 2 just for some variety</p>
  
  <pre><code>string sMailToLink = @"mailto:some.address@gmail.com?subject=Hey&amp;body= yeah yeah yeah";
  IntPtr result = ShellExecute(IntPtr.Zero, "open", sMailToLink, "", "", ShowCommands.SW_SHOWNORMAL);
  Debug.Assert(result.ToInt32() &gt; 32, "Shell Execute failed with return code " + result.ToInt32());
  </code></pre>
  
  <p>The same MailtoLink works perfectly with Process.Start... but <em>as long as thou shalt not mention attachments</em>.</p>
  
  <pre><code>System.Diagnostics.Process.Start(sMailToLink);
  </code></pre>
  
  <p>The other options are using the Outlook Object model to do this.. but I've been told that this requires you to add assembly references  based to the exact version of Outlook installed. Also this would blow up if the user doesn't prefer MS for email.</p>
  
  <p>The next option are Mapi and something called <a href="http://g8.cx/mapi/" rel="noreferrer">Mapi33</a>.. Status still IN PROGRESS. Ears still open to suggestions.</p>