tags:

views:

284

answers:

4

Using C#/.Net, how can I determine which program is registered as the default email client? I don't need to launch the app, I just want to know what it is.

+8  A: 

You can look in the registry on the following key:

HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail
Sani Huttunen
+1 only a bit faster that me...
Jonathan
+3  A: 

You can read this key of the registry

HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail

Jonathan
+1  A: 

I think you should be able to find that info in the registry at HKLM\Software\Clients\Mail.

Look for the default string value.

bruno conde
+3  A: 

Use the Registry class to search the registry. This console app demonstrates the principle.

using System;
using Microsoft.Win32;

namespace RegistryTestApp
{
   class Program
   {
      static void Main(string[] args)
      {
         object mailClient = Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail", "", "none"); 
         Console.WriteLine(mailClient.ToString());
      }
   }
}
Richie Cotton