[dba-VB] [AccessD] OT - Detecting Name/Address of SMTP server

Stuart McLachlan stuart at lexacorp.com.pg
Thu Jul 10 04:31:11 CDT 2003


On 10 Jul 2003 at 8:38, paul.hartland at fsmail.net wrote:

> ok,  say I haven't got my email open and I want to show my SMTP server name/address in a VB6 program how would I do that....
> 

That depends :-)

We probably need a lot more info about how you are set up and what 
you are actually trying to achieve.

To send Interent mail, you can use any SMTP server on the Internet 
that will accept your mail, either after authentication - or any 
other server that is an "open relay" (but your message is likely to 
be blacklisted and not reach it's destination in that case)

However, most people have one or more SMTP servers defined in their 
email client.

You can find the name of your current SMTP server(s) in various ways. 
If you are sensible enough to be using the latest version fo Pegasus 
Mail, you can parse it from the various SMTxxxx.PND files in your 
mail directory. If you are foolish enough to use Outlook, you need to 
find the various SMTP server names in the registry by looking for 
entries like 
HKEY_USERS\xxxxx....xxxxx\Software\Microsoft\Office\Outlook\OMI 
Account Manager\Accounts\0000000x\SMTP Server.

I really don't know how other clients store this info.

Once you have found the name of the server, you can get it's address 
by doing a DNS lookup.  That will probably involve using the Winsock 
API  function GetHostByName().


-- 
Lexacorp Ltd
http://www.lexacorp.com.pg
Information Technology Consultancy, Software Development,System 
Support.





More information about the AccessD mailing list