CheckSMTPServer Method

This method attempts to bind a TCP/IP socket to the SMTP server port 25 on the machine specified.  If successful, it immediately closes the socket.  Use this method to verify the connectivity to an SMTP server before starting a mailing package.

IDL Definition

HRESULT CheckSMTPServer([in] BSTR bstrSMTP);

Parameters

bstrSMTP

the name of the machine hosting the SMTP server.  The name must be a valid DNS name for the machine.  This name is used to do an IP address lookup when creating the TCP/IP socket connection to the server.  The well-known SMTP port 25 is used when binding the socket.

Return Value

the HRESULT returned can have one of the following values:

#define Name Description
S_OK success.
E_INVALIDARG the name passed could not be resolved to a valid IP address..
E_OUTOFMEMORY an error occurred during a memory initialization routine.  The system has run out of memory..
TMAIL_E_CONNECT_FAILED a TCP/IP connection could not be established with the specified machine.


© 1997-1998 Microsoft Corporation. All rights reserved.