Platform SDK: CDO for Windows 2000 |
When sending or posting messages over the network, many SMTP and NNTP services require clients to authenticate themselves. To configure a Message object for authentication, perform the following steps:
For NNTP, set the http://schemas.microsoft.com/cdo/configuration/postusername and http://schemas.microsoft.com/cdo/configuration/postpassword fields.
When using the NTLM authentication mechanism, the current process and/or thread's security context is used.
' 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 ' Use string constants provided in the type library ' for field names (they are long) Flds(cdoSendUsingMethod) = cdoSendUsingPort Flds(cdoSMTPServer) = "mail.microsoft.com" Flds(cdoSMTPServerPort) = 26 Flds(cdoSMTPConnectionTimeout) = 30 Flds(cdoSMTPAccountName) = "My Name" Flds(cdoSendUserReplyEmailAddress) = """User"" <user@microsoft.com>" Flds(cdoSendEmailAddress) = """User"" <user@microsoft.com>" Flds(cdoSMTPAuthenticate) = cdoBasic Flds(cdoSendUserName) = "name" Flds(cdoSendPassword) = "password" Flds.Update Dim iMsg As New CDO.Message Set iMsg.Configuration = iConf ' go on to use Message instance
http://schemas.microsoft.com/cdo/configuration/smtpauthenticate
http://schemas.microsoft.com/cdo/configuration/nntpauthenticate
http://schemas.microsoft.com/cdo/configuration/sendusername
http://schemas.microsoft.com/cdo/configuration/sendpassword