Const cdoSendUsingMethod1 = "httpschemasmicrosoftcom/cdo/configuration/sendusing" Const cdoSendUsingPort1 = 2 Const cdoSMTPServer1 = _ "httpschemasmicrosoftcom/cdo/configuration/smtpserver" Const cdoSMTPServerPort1 = _ "httpschemasmicrosoftcom/cdo/configuration/smtpserverport" Const cdoSMTPConnectionTimeout1 = _ "httpschemasmicrosoftcom/cdo/configuration/smtpconnectiontimeout" Const cdoSMTPAuthenticate1 = _ "httpschemasmicrosoftcom/cdo/configuration/smtpauthenticate" Const cdoBasic1 = 1 Const cdoSendUserName1 = _ "httpschemasmicrosoftcom/cdo/configuration/sendusername" Const cdoSendPassword1 = _ "httpschemasmicrosoftcom/cdo/configuration/sendpassword" Dim objConfig ' As CDO.Configuration Dim objMessage ' As CDO.Message Dim Fields ' As ADODB.Fields ' Get a handle on the config object and it's fields Set objConfig = Server.CreateObject("CDO.Configuration") Set Fields = objConfig.Fields ' Set config fields we care about With Fields .Item(cdoSendUsingMethod1) = cdoSendUsingPort1 .Item(cdoSMTPServer1) = "email.sever.com" .Item(cdoSMTPServerPort1) = 25 .Item(cdoSMTPConnectionTimeout1) = 10 .Item(cdoSMTPAuthenticate1) = cdoBasic1 .Item(cdoSendUserName1) = "mail@example.com" .Item(cdoSendPassword1) = "123" .Update End With Set objMessage = Server.CreateObject("CDO.Message") Set objMessage.Configuration = objConfig With objMessage .To = mailto .From = mailto .Subject = AP .TextBody = AP & Now() .Send End With Set Fields = Nothing Set objMessage = Nothing Set objConfig = Nothing
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)