Make sendmsg.asp file on root.

<%
Const cdoSendUsingMethod        = "http://schemas.microsoft.com/cdo/configuration/sendusing"
Const cdoSendUsingPort          = 2
Const cdoSMTPServer             = "http://schemas.microsoft.com/cdo/configuration/smtpserver"
Const cdoSMTPServerPort         = "http://schemas.microsoft.com/cdo/configuration/smtpserverport"
Const cdoSMTPConnectionTimeout  = "http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"
Const cdoSMTPAuthenticate       = "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"
Const cdoBasic                  = 1
Const cdoSendUserName           = "http://schemas.microsoft.com/cdo/configuration/sendusername"
Const cdoSendPassword           = "http://schemas.microsoft.com/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(cdoSendUsingMethod)       = cdoSendUsingPort
.Item(cdoSMTPServer)            = "mailservername"
.Item(cdoSMTPServerPort)        = 25
.Item(cdoSMTPConnectionTimeout) = 10
.Item(cdoSMTPAuthenticate)      = cdoBasic
.Item(cdoSendUserName)          = "domain mail address"
.Item(cdoSendPassword)          = "sendmsg@asp"

.Update
End With

Set objMessage = Server.CreateObject("CDO.Message")

Set objMessage.Configuration = objConfig

With objMessage
.To       = "ABC XYZ "
.From     = "XYZ ABC "
.Subject  = "SMTP Relay Test"
.TextBody = "SMTP Relay Test Sent @ " & Now()
.Send
End With

Set Fields = Nothing
Set objMessage = Nothing
Set objConfig = Nothing
%>

Was this answer helpful? 2 Users Found This Useful (8 Votes)