Finding the SMTP server name

Is there any way to detect a machine's SMTP server name automatically either
through Win API functions or Registry. I am using Microsoft Outlook Express
v5.0 and I found an entry in the Windows Registry as follows

HKEY_CURRENT_USER\Software\Microsoft\Internet Account
Manager\Accounts\00000002\SMTP Server

Is this the same for all email clients?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

The location of the SMTP server name depends on the EMAIL client in use.  Outlook Express does indeed store it in the registry as you have shown above.  Other mail programs use different locations.  Eudora, for example, stores it in it's own INI file.  Netscape Navigator Mail uses it's prefs.js javascript setup file to store it.  Others do it in the registry but not in the same place as Outlook Express.

Since SMTP is not a standard MS Windows service setting, there is no standard way of detecting it.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sivaramyAuthor Commented:
It is disappointing to know that there is no direct way.

Any way Thank you very much for your help.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.