% ' mail-cdo-test.asp dim sn sn = "myServer" dim PageName PageName = "Test outgoing CDO mail functionality" response.write "
Timestamp: " & now & "
" dim sMessage ' As string sMessage = "Contact has been made." & vbCrLf & "This is a test message from the cdo script on [" & sn & "]." & vbCrLf Dim objConfig ' As CDO.Configuration Set objConfig = Server.CreateObject("CDO.Configuration") Dim Fields ' As ADODB.Fields Set Fields = objConfig.Fields ' Set configuration fields we care about With Fields .Item(cdoSendUsingMethod) = cdoSendUsingPort ' send method .Item(cdoSMTPServerPort) = 25 ' smtp port # .Item(cdoSMTPConnectionTimeout) = 20 ' Connection Timeout .Item(cdoSMTPAuthenticate) = cdoBasic ' basic authentication .Item(cdoSMTPServer) = "smtp.example.com" ' a real smtp server .Item(cdoSendUserName) = "example@example.com" ' a real user name .Item(cdoSendPassword) = "password" ' a real password .Update End With response.write "Sending mail to: " & objMessage.To & "
" response.write "Sending mail cc: " & objMessage.CC & "
" response.write "Subject: " & objMessage.Subject & "
" response.write "Message content:..
" & objMessage.TextBody & "" response.write "
Timestamp: " & now & "
" on error resume next objMessage.Send select case err.number case 0 Response.Write "Success ... message sent
" case else Response.Write "Send failed, error is ...
" Response.Write "Timestamp: " & now & "
" %>