Platform SDK: Exchange 2000 Server

Sending or Posting Using the Network

[This is preliminary documentation and subject to change.]

Perform the following steps to send messages over the network.

  1. Set the http://schemas.microsoft.com/cdo/configuration/sendusing or http://schemas.microsoft.com/cdo/configuration/postusing field to cdoSendUsingPort or CdoPostUsingPort in the Configuration object.
  2. Set the http://schemas.microsoft.com/cdo/configuration/smtpserver or http://schemas.microsoft.com/cdo/configuration/nntpserver field to a resolvable name (DNS or NetBIOS) for an SMTP or NNTP service on the network.
  3. Set the following additional fields used with network configurations.
    Name Description
    smtpserverport

    nntpserverport

    The port to use when connecting the service. Defaults are 25 and 119.
    smtpconnectiontimeout

    nntpconnectiontimeout

    The timeout in seconds for attempted connections to the service. Default is 30 seconds.
    smtpaccountname

    nntpaccountname

    The account name.
    smtpauthenticate

    nntpauthenticate

    The mechanism (if any) used to authenticate with the service.
    smtpusessl

    nntpusessl

    Indicates whether or not to use Secure Sockets Layer (SSL) for the connection.
    sendusername

    senduserpassword

    The username and password used to authenticate using the Basic Authentication mechanism. These fields are also used when sending using Microsoft Exchange 2000 Server to look up the Exchange service in which their mailbox resides.

The following example demonstrates explicitly setting various fields used when sending messages over the network.

' 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 for Network Send
Flds(cdoSendUsingMethod)          = cdoSendUsingPort
Flds(cdoSMTPServer)               = "mail.microsoft.com"
Flds(cdoSMTPServerPort)           = 25
Flds(cdoSMTPConnectionTimeout)    = 30
Flds(cdoSMTPAccountName)          = "My Name"
Flds(cdoSendUserReplyEmailAddress)= """User"" <user@microsoft.com>"
Flds(cdoSendEmailAddress)         = """User"" <user@microsoft.com>"
' ... other settings
Flds.Update

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

' go on to use Message instance

Many of these settings can be loaded if Outlook Express is installed on the local machine. Only the settings for the default account, default identity can be used. See Using Default Configuration Settings for more information.