Platform SDK: CDO for Windows 2000

Setting Network Proxy Information

When using methods such as IMessage.AddAttachment and IMessage.CreateMHTMLBody, you may need to access network resources through a proxy server. You set up the proxy configuration for a Message object as follows:

  1. Set the http://schemas.microsoft.com/cdo/configuration/urlproxyserver field in the IConfiguration.Fields collection of the Configuration object.
  2. Optionally set the http://schemas.microsoft.com/cdo/configuration/urlproxybypass field to the value "<local>". With this setting, the proxy service will be bypassed for local addresses.
  3. Optionally set the http://schemas.microsoft.com/cdo/configuration/urlgetlatestversion field to force retrieval of resources directly and bypass the cache.
[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
Flds(cdoSendUsingMethod)           = cdoSendUsingPort
Flds(cdoSMTPServer)                = "mail.microsoft.com"
Flds(cdoSMTPServerPort)            = 26 ' non-standard port
Flds(cdoSMTPConnectionTimeout)     = 30
Flds(cdoSMTPAccountName)           = "My Name"
Flds(cdoSendUserReplyEmailAddress) = """User"" <user@microsoft.com>"
Flds(cdoSendEmailAddress)          = """User"" <user@microsoft.com>"
Flds(cdoURLProxyServer)            = "proxyserver:80"
Flds(cdoURLProxyBypass)            = "<local>"
Flds(cdoURLGetLatestVersion)       = True
Flds(cdoHTTPCookies)               = "cookies here"
' ... other settings
Flds.Update

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

' go on to use Message object

See Also

http://schemas.microsoft.com/cdo/configuration/urlproxyserver

http://schemas.microsoft.com/cdo/configuration/urlproxybypass

http://schemas.microsoft.com/cdo/configuration/urngetlatestversion