Solved

Getting the default mail host using delphi

Posted on 2000-04-04
1
291 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 

Accepted Solution

by:
Carpathia earned 100 total points
ID: 2686726
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

740 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