Platform SDK: CDO for Windows 2000

Setting the Send and Post Method

With the Message object, you have the option of choosing how messages are sent or posted for delivery. These options depend on the software installed on the computer that is running your Microsoft Collaboration Data Objects (CDO) application. The following table lists these methods and describes when each method is available.

Method Description
Pickup Directory If the application is running on a computer that has installed Simple Mail Transfer Protocol (SMTP) or Network News Transfer Protocol (NNTP) services, you can use that services pickup directory.
Network using SMTP or NNTP You can connect directly to an SMTP or NNTP service and use SMTP or NNTP, respectively, to send or post a message.

To set the send or post method for messaging objects, perform the following tasks:

  1. Set the http://schemas.microsoft.com/cdo/configuration/sendusing and http://schemas.microsoft.com/cdo/configuration/postusing fields to the desired method in the associated Configuration object. The methods listed in the previous table are identified with enumerations CdoSendUsing and CdoPostUsing.
  2. Set any required or optional configuration fields that correspond to the send or post method.

The required and optional fields depend on the send or post mechanism.

[Visual Basic]
' Reference to Microsoft ActiveX Data Objects 2.5 Library
' Reference to Microsoft CDO for Windows 2000 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
' .. set additional fields
Flds.Update

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

See Also

Sending or Posting Using the Network

Sending or Posting Using the Pickup Directory

http://schemas.microsoft.com/cdo/configuration/sendusing Field

http://schemas.microsoft.com/cdo/configuration/postusing Field