I wrote an Outlook (2010+) C# add-in and having some trouble with different email servers. As I found specific solutions for each server type I would like to know if there is an way to get the information to which email server an Outlook account points? It would be totally sufficient to get the name of the underlying email server software as version numbers are not neccessary to know.
Something like
string serverSoftware = account.server.softwareName;
would be great...
You can look for the accounts clsid or service name in the registry.
For Outlook 2010 and earlier:
HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\{0}\9375CFF0413111d3B88A00104B2A6676
For Outlook 2013:
HKCU\Software\Microsoft\Office\15.0\Outlook\Profiles\{0}\9375CFF0413111d3B88A00104B2A6676
You have to replace {0} by Account.Session.CurrentProfileName
In this location iterate all subkeys and look for the "Account Name", that will match to Account.DisplayName
Okay, now it's getting a bit more difficult:
First check the value of "clsid" against this list:
In case of the last clsid, check "Service Name". For Exchange accounts, it will be "MSEMS", while i.e. a Kerio Connect account would return "KERIOOCF" as service name.