Reputation: 21
I would like to set the standard email client in Windows 7 from .NET code, how do I do it?
Upvotes: 1
Views: 476
Reputation: 11063
You can find the default email program with the following Registry Key. Find it's content and mess with it:
Check the following link here at SO:
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());
}
}
}
Upvotes: 1
Reputation: 2020
You would need to edit the following registry value. You would do something like the following with the Registry.SetValue Method.
Registry.SetValue(@"HKEY_CLASSES_ROOT\mailto\shell\open\command", "", "\"C:\\PROGRA~2\\MICROS~1\\Office14\\OUTLOOK.EXE\" -c IPM.Note /m \"%1\"");
Upvotes: 1