Getting the default mail host using delphi

I am wanting to use the TNMSMTP component to send mail. I would however like to know how it is possible to get the default mail client's host address.
Is it an API call or a registry setting?

Who is Participating?
CarpathiaConnect With a Mentor Commented:
Use the registry to read the value of "Default Mail Account" from the key

HKEY_CURRENT_USER\Software\Microsoft\Internet Account Manager

This is a number (on my machine its 2).

Now get to this tree

HKEY_CURRENT_USER\Software\Microsoft\Internet Account Manager\Accounts

and open the key of the number youve just got (ie, \2 on my machine).

This contains info for the default account.

From this you can get
SMTP Server.

Have a look in regedit to understand what I mean.

Hope this helps.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.