Click here to Skip to main content
Click here to Skip to main content

Open Default mail client in .NET

, 1 Jan 2004
Rate this:
Please Sign up or sign in to vote.
hi i wanted to write an application where i could open my browsers default mail client, i was unable to find any thing in .NET hence this code.. enjoy


I was writing an emailing application in VB.NET when I came across a situation where I needed to load the default email client of the user's machine with all the email fields filled up.  I was not able to find a suitable solution for this on the Internet hence I thought why not write one.  It is easy to understand.  For comments please mail me at


Building The Message

public class OpenDefaultClient
Function openclient()
'string builder used for concatination
Dim MsgBuilder As New System.Text.StringBuilder
MsgBuilder.Append("<A href=""></A>")
MsgBuilder.Append("<A href="mailto:&,">&,</A>")
MsgBuilder.Append("<A href="mailto:&,">&,</A>")
MsgBuilder.Append("&subject=this is test subject")
MsgBuilder.Append("&body=this is test body")
End Function 

Starting The Default Email Client

Private Function ExecuteFile(ByVal FileName As String) As Boolean
Dim myProcess As New Process
myProcess.StartInfo.FileName = FileName
myProcess.StartInfo.UseShellExecute = True
myProcess.StartInfo.RedirectStandardOutput = False
End Function


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Web Developer
India India
hi i lovvvvvvvvvvvvvvvvvvvveeeeeeeeeeeee CodeProject Wink | ;)

Comments and Discussions

QuestionWhy is this voted so low? PinmemberPak51422-Jan-09 4:54 
GeneralMy vote of 2 Pinmembermahi_198818-Dec-08 3:02 
GeneralHo to develop Same application in ASP.NEt [modified] PinmembermrMdpendable3-Jul-08 18:57 
GeneralNot working with ASP.Net and c# as code behind Pinmembershdeo18-Jul-07 2:22 
QuestionAttachment doesn't work for me PinmemberTiman Zhao28-Jun-07 22:34 
AnswerRe: Attachment doesn't work for me PinmemberTiman Zhao28-Jun-07 23:34 
Hi guys,

I found a great solution. it's here.

Laugh | :laugh:
GeneralLength restriction Pinmemberzespri1-Mar-06 18:22 
GeneralRe: Length restriction Pinmemberleggan22-Apr-08 6:27 
Question&body problem PinmemberRob 1234523-Feb-06 2:19 
AnswerRe: &body problem PinmemberRob 1234524-Feb-06 19:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.150414.1 | Last Updated 2 Jan 2004
Article Copyright 2004 by Melu
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid