Platform SDK: CDO for Windows 2000 |
Perform the following steps to send messages over the network.
Name | Description |
---|---|
smtpserverport
nntpserverport |
The port to use when connecting the SMTP or NNTP service. Defaults are 25 and 119 respectively. |
smtpconnectiontimeout
nntpconnectiontimeout |
The timeout in seconds for attempted connections to the service. Default is 30 seconds. |
smtpaccountname
nntpaccountname |
The SMTP account name. |
smtpauthenticate
nntpauthenticate |
The mechanism (if any) used to authenticate with the service. |
smtpusessl
nntpusessl |
A boolean flag indicating whether to use Secure Sockets Layer (SSL) for the connection. |
The following example demonstrates how to explicitly set the various fields used when sending messages over the network. Note the use of the constants found in the CDO type library.
' 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 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 object
Many of these settings can be loaded if Microsoft® Outlook® Express is installed on the local computer. Only the settings for the default account and default identity can be used. See Using Default Configuration Settings for more information.
Sending or Posting Using the Pickup Directory
http://schemas.microsoft.com/cdo/configuration/sendusing Field
http://schemas.microsoft.com/cdo/configuration/postusing Field