Sending Email with CDO.Message in Classic ASP

Many legacy Classic ASP applications send mail through the Windows CDO component using CDO.Message. Whether this works depends on the Windows/IIS environment and SMTP configuration available on the server.

Environment note: CDOSYS/CDO is legacy Windows technology. Keep it for maintaining existing Classic ASP systems, but confirm that your hosting environment still provides the component and an authenticated/allowed SMTP route.

Send a text message

<%
Dim plusMail
Set plusMail = CreateObject("CDO.Message")
plusMail.Subject = "Message from the website"
plusMail.From = "website@example.com"
plusMail.To = "recipient@example.com"
plusMail.TextBody = "This is the text body of the mail"
plusMail.Send
Set plusMail = Nothing
%>

Use a fixed sender address that your mail system authorizes. For contact forms, do not place an arbitrary visitor address directly in From; validate it and use an appropriate Reply-To/configuration pattern supported by your mail setup.

CC and BCC

<%
Dim plusMail
Set plusMail = CreateObject("CDO.Message")
plusMail.Subject = "Message from the website"
plusMail.From = "website@example.com"
plusMail.To = "recipient@example.com"
plusMail.CC = "copy@example.com"
plusMail.Bcc = "archive@example.com"
plusMail.TextBody = "This is the text body of the mail"
plusMail.Send
Set plusMail = Nothing
%>

HTML email

<%
Dim plusMail
Set plusMail = CreateObject("CDO.Message")
plusMail.Subject = "HTML message from the website"
plusMail.From = "website@example.com"
plusMail.To = "recipient@example.com"
plusMail.HTMLBody = "<h1>Welcome</h1><p>This is an HTML message.</p>"
plusMail.Send
Set plusMail = Nothing
%>
Do not insert raw visitor-controlled HTML into HTMLBody. Validate form fields, control message structure on the server, add anti-spam/abuse protection, and avoid exposing SMTP credentials in tutorial output or public source.

ASP Home






✖
We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
© 2000-2026 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer