Share via


Sending or Posting using the Pickup Directory

Sending or Posting using the Pickup Directory

If an SMTP or NNTP service is installed on the local computer, you can send or post messages using the pickup directory associated with the service. To send messages using the pickup directory, perform the following steps:

  1. Set the https://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory or https://schemas.microsoft.com/cdo/configuration/nntpserverpickupdirectory field in the Configuration object's IConfiguration.Fields collection.
  2. Optionally, set the https://schemas.microsoft.com/cdo/configuration/flushbuffersonwrite field to True to avoid file system buffering. Setting this flag will impact performance, as each message must be written directly to disk. However, in the event of an interruption of service, messages will not be lost due to file system buffering.

These settings are defined for each SMTP and NNTP virtual service instance.

' 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
Flds(cdoSendUsingMethod) = cdoSendUsingPickup
Flds(cdoPostUsingMethod) = cdoPostUsingPickup
Flds(cdoSMTPServerPickupDirectory) = "C:\InetPub\mailroot\Pickup"
Flds(cdoNNTPServerPickupDirectory) = "C:\InetPub\nntpfile\pickup"
Flds(cdoFlushBuffersOnWrite) = True
Flds(cdoSendEmailAddress) = """User"" <example@example.com>"
' ... other settings
Flds.Update

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

' go on to use Message object

See Also

Concepts

smtpserverpickupdirectory Field
nntpserverpickupdirectory Field
flushbuffersonwrite Field