Solved

Getting the default mail host using delphi

Posted on 2000-04-04
1
285 Views
Last Modified: 2010-04-04
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?

Thanks
0
Comment
Question by:Fugazi
1 Comment
 

Accepted Solution

by:
Carpathia earned 100 total points
Comment Utility
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 Port
and
SMTP Server.

Have a look in regedit to understand what I mean.

Hope this helps.



0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now