Platform SDK: CDO for Windows 2000 |
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:
' 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
http://schemas.microsoft.com/cdo/configuration/urlproxyserver
http://schemas.microsoft.com/cdo/configuration/urlproxybypass
http://schemas.microsoft.com/cdo/configuration/urngetlatestversion