Click here to Skip to main content
14,695,499 members
Articles » General Programming » Programming Tips » General
Tip/Trick
Posted 8 Jun 2011

Tagged as

Stats

23.5K views
3 bookmarked

Get Default Mail Client Name

Rate me:
Please Sign up or sign in to vote.
2.80/5 (2 votes)
8 Jun 2011CPOL
How to get the default mail client name.
Here is the code:
public string getDefaultMailClient()
{
  try
  {
      object mailClient = Registry.GetValue(
        @"HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail", "", "none");
      return mailClient.ToString();
  }
  catch (Exception exGetDefaultMailClient)
  {
      Util.EscribirLog(exGetDefaultMailClient.Message);
      return "Outlook Express";
  }
}

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Gustavo Mena
Software Developer gmSoft
Argentina Argentina
This member doesn't quite have enough reputation to be able to display their biography and homepage.

Comments and Discussions

 
GeneralIn Alternate 1, hkey returns a string ¨mailto\shell\open\com... Pin
Salam Y. ELIAS21-Jun-11 9:20
professionalSalam Y. ELIAS21-Jun-11 9:20 
GeneralReason for my vote of 3 Agreed with the others who have comm... Pin
Ed Nutting14-Jun-11 10:15
MemberEd Nutting14-Jun-11 10:15 
GeneralReason for my vote of 2 Nice short how to but needs to be dr... Pin
NetSecurity14-Jun-11 3:40
MemberNetSecurity14-Jun-11 3:40 
GeneralAgree with nbgangsta. Update your code. Pin
thatraja10-Jun-11 18:01
professionalthatraja10-Jun-11 18:01 
GeneralBetter yet; just throw an exception. If it's unable to find ... Pin
JV99998-Jun-11 22:43
professionalJV99998-Jun-11 22:43 
GeneralYou're returning Outlook Express if you're unsuccessful? Are... Pin
Groulien8-Jun-11 22:07
MemberGroulien8-Jun-11 22:07 

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

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