Platform SDK: Exchange 2000 Server

Configuring Network Authentication Information

[This is preliminary documentation and subject to change.]

When sending or posting messages over the network, many SMTP and NNTP services require clients to authenticate themselves. To configure a messaging object for authentication, perform the following steps:

  1. Set the http://schemas.microsoft.com/cdo/configuration/smtpauthenticate or http://schemas.microsoft.com/cdo/configuration/nntpauthenticate fields in the Configuration object's IConfiguration.Fields collection. The possible values are defined by the CdoProtocolsAuthentication enumeration.
  2. If the mechanism is set to cdoBasic, set the username and password. For SMTP, set the http://schemas.microsoft.com/cdo/configuration/sendusername and http://schemas.microsoft.com/cdo/configuration/sendpassword configuration fields. For NNTP, set the http://schemas.microsoft.com/cdo/configuration/postusername and http://schemas.microsoft.com/cdo/configuration/postpassword fields.

For the NTLM setting, the current process/thread security context is used to authenticate.

' Reference to Microsoft ActiveX Data Objects 2.5 Library
' Reference to Microsoft CDO for Exchange 2000 Server Library
' ..
Dim iConf As New CDO.Configuration
Dim Flds  As ADODB.Fields
Set Flds  = iConf.Fields

' Set the configuration
' Use string constants provided in the type library
' for field names (they are long)
Flds(cdoSendUsingMethod)           = cdoSendUsingPort
Flds(cdoSMTPServer)                = "mail.microsoft.com"
Flds(cdoSMTPServerPort)            = 26
Flds(cdoSMTPConnectionTimeout)     = 30
Flds(cdoSMTPAccountName)           = "My Name"
Flds(cdoSendUserReplyEmailAddress) = """User"" <user@microsoft.com>"
Flds(cdoSendEmailAddress)          = """User"" <user@microsoft.com>"
Flds(cdoSMTPAuthenticate)          = cdoBasic
Flds(cdoSendUserName)              = "name"
Flds(cdoSendPassword)              = "password"
Flds.Update

Dim iMsg As New CDO.Message
Set iMsg.Configuration = iConf

' go on to use Message instance