Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find default email client

Using C#, 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.

like image 755
epotter Avatar asked Jul 13 '09 14:07

epotter


1 Answers

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());
      }
   }
}
like image 185
Richie Cotton Avatar answered Sep 25 '22 14:09

Richie Cotton