Click here to Skip to main content
16,020,677 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am writing a Mailing Dll,using Winsock2. It requires a Host Name. I imagine that that is somewhere hidden in the Registry, my AOL Browser, can find it. Where do I find it. Any Idea's?

Regards,


Bram :)
Posted

If you mean local computer's name, you can benefit from GetComputerNameEx(...)[^] or GetComputerName(...)[^] functions.

You can also get host name by using Winsock functions getnameinfo() or gethostbyaddr() if you have an IP address.
 
Share this answer
 
Comments
Bram van Kampen 23-Mar-11 4:42am    
It is NOT the Computer name. It appears to be the name of my email host. (in my case the email host provided by AOL). I assume this can be found somewhere in the registry, the question is 'WHERE'.

Bram :)
Emilio Garavaglia 23-Mar-11 6:54am    
It is a parameter a e-mail client MUST know. An AOL browser is probably part of an integrated suite that has an e-mail client, and probably this integrated suite save this parameter in a (for it) "well known place".

But there is no "standard" about it. If you have a different e-mail client it will probably ask for this information during setup and save it somewhere else it likes.

Now, if such a value is saved in a place that is accessible to your APP you can use it, but this will make your app dependent on the AOL suite.

Note: if it is a registry key, just use REGEDIT to search for the value you know, and you will discover the key.
Ozer Karaagac 23-Mar-11 10:29am    
Sorry for my misunderstanding. You mean email provider's server name or its user name. :-) I haven't noticed that this is an AOL specific question. I don't know much about AOL, I know "C++" only. Like Emilio said, it may be handled by email client and it may also be stored into a configuration file if you are not sure about registry.
I don't think it requires "a" hostname. It requires "the" hostname suitable for some task. if it is the local hostname, you can use "localhost" or "127.0.0.1".
If it is some other server, you should already know it (and, in general, it wold be better if you don't hard-code, but read it from a configuration file or registry section.
 
Share this answer
 
Comments
Bram van Kampen 23-Mar-11 4:43am    
See Comment to Solution 1

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900