E-mail Code Examples
ASPEmail Code Example
Dim objMail
Set objMail = Server.CreateObject("Persits.MailSender")
objMail.From = "user@domain.co.za"
objMail.FromName = "User"
objMail.Host = "localhost"
objMail.AddAddress "user@domain.co.za", "User"
objMail.Subject = "ASPEmail Test"
objMail.Body = "The body."
objMail.Send
Set objMail = Nothing
To check if ASPEmail is functioning correctly, please enter your e-mail address in the field below, and press the ‘Submit’ button.
JMail Code Example
Dim objMail
Set objMail = Server.CreateObject("JMail.Message")
objMail.From = "user@domain.co.za"
objMail.FromName = "User"
objMail.AddRecipient "user@domain.co.za", "User"
objMail.Subject = "ASPEmail Test"
objMail.Body = "The body."
objMail.Send("localhost")
Set objMail = Nothing
To check if JMail is functioning correctly, please enter your e-mail address in the field below, and press the ‘Submit’ button.
CDOSYS E-mail Code Example
Const cdoSendUsingMethod =
"http://schemas.microsoft.com/cdo/configuration/sendusing"
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"
Dim objConfig
Dim objMessage
Dim Fields
Set objConfig = Server.CreateObject("CDO.Configuration")
Set Fields = objConfig.Fields
With Fields
.Item(cdoSendUsingMethod) = 2
.Item(cdoSMTPServer) = "localhost"
.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPConnectionTimeout) = 10
.Update
End With
Set objMessage = Server.CreateObject("CDO.Message")
Set objMessage.Configuration = objConfig
With objMessage
.To = "User <user@domain.co.za>"
.From = "User <user@domain.co.za>"
.Subject = "CDOSYS Test"
.TextBody = "The body."
.Send
End With
Set Fields = Nothing
Set objMessage = Nothing
Set objConfig = Nothing
To check if CDOSYS is functioning correctly, please enter your e-mail address in the field below, and press the ‘Submit’ button.
