Classic ASP send mail with CDOSYS in VBScript Sample Code
Note: your_domain_name.com is your actual domain name. name is your actual email address name. your_email_password is your actual email password.
<!--
METADATA
TYPE="typelib"
UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
NAME="CDO for Windows 2000 Library"
-->
<%
Set cdoConfig = CreateObject("CDO.Configuration")
With cdoConfig.Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "mail.your_domain_name.com"
.Item(cdoSMTPAuthenticate) = 1
.Item(cdoSendUsername) = "name@your_domain_name.com"
.Item(cdoSendPassword) = "your_email_password"
.Update
End With
Set cdoMessage = CreateObject("CDO.Message")
With cdoMessage
Set .Configuration = cdoConfig
.From = "name@your_domain_name.com"
.To = "name@your_domain_name.com"
.Subject = "CDOSYS Message"
.TextBody = "CDOSYS Message sent with SMTP Authentication"
.Send
End With
Set cdoMessage = Nothing
Set cdoConfig = Nothing
Response.write "Message Sent"
%>
Article ID: 2, Created: June 14, 2013 at 7:53 AM, Modified: May 10, 2018 at 8:34 PM