Sending E-Mail With The Users Default Program

Just use the code below. I’m sure you will want to replace the hard-coded values with parameters from a method.

Dim mailProcess As New Process()
Dim processInfo As New System.Diagnostics.ProcessStartInfo()
  processInfo.FileName = "mailto:someone@someone.com?" _
                            & "cc=someoneelse@someone.com&" _
                            & "subject=Sample Subject&" _
                            & "body=Body of Message"
  processInfo.UseShellExecute = True
  processInfo.WindowStyle = ProcessWindowStyle.Normal
  mailProcess.StartInfo = processInfo
  mailProcess.Start(processInfo)

Tip Submitted By: David McCarter

This code can be found in the open source dotNetTips.Utility assembly