title: How to open default email client with attachment
body: <p>I'm working on an issue to my project that when I click the button, a default email client should pop out and if there's an attachment, it should be automatically attach to the default email client like this.</p>
  
  <p><a href="https://i.stack.imgur.com/ePxJ0.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ePxJ0.png" alt="enter image description here"></a></p>
  
  <p>I already tried a lot of methods how to do this. First I used MAPI, but the MAPI cannot detect my Default Email Client even though I already set it in Control Panel, It shows this two message box</p>
  
  <p><a href="https://i.stack.imgur.com/Jfusp.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Jfusp.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/bfolL.png" rel="noreferrer"><img src="https://i.stack.imgur.com/bfolL.png" alt="enter image description here"></a></p>
  
  <p>I already searched the internet about those error but there's no definite or clear answer to me. <a href="https://stackoverflow.com/a/32650882/2637261">HERE'S</a> the code I used in MAPI.</p>
  
  <p>I used also the <code>mail:to</code> protocol to call the default email client who's handling to the aforementioned protocol with using this line of codes.</p>
  
  <pre><code>Dim proc As System.Diagnostics.Process = New System.Diagnostics.Process()
  
              Dim filename = Convert.toChar(34) &amp; "C:\USERS\JOSHUA~1.HER\DOWNLO~1\ASDPOR~1.PDF" &amp; Convert.toChar(34)
              Debug.Writeline(filename)
              Dim asd As String = String.Format("mailto:someone@somewhere.com?subject=hello&amp;body=love my body&amp;Attach={0}", filename)
              proc.StartInfo.FileName = asd
              proc.Start()
  </code></pre>
  
  <p>But still, no luck. I read a thread that the <code>mail:to</code> don't handle attachment anymore, but this line of code opened my default email client with body and subject, but there's no attachment. In terms of the <code>filename</code> variable, I already tried every path format, I read that I should use 8.3 path format. But still doesn't work.</p>
  
  <p>The last method I used is extending the <code>System.Net.MailMessage.MailMessage()</code> following <a href="https://stackoverflow.com/a/25586282/2637261">THIS</a> answer. This works in terms of opening the default email client and attaching an attachment to a mail, but this is not editable and there's no send button on the default email client because this line of code just generating an .eml file and opening it. I'm thinking of parsing the eml file but still I don't know how to open the default email client progmatically in a new message form. Here's the photo</p>
  
  <p><a href="https://i.stack.imgur.com/BdKk6.png" rel="noreferrer"><img src="https://i.stack.imgur.com/BdKk6.png" alt="enter image description here"></a></p>
  
  <p>You guys have any idea how to make this possible? Thanks!</p>