Classic ASP – Sending Mail using CDO
Jun 22, 2009 Classic ASP, Web Development Tips
I needed this ASP tip for a client the other day, thought I’d post it for my future reference and to help others that need to send an email on a classic ASP site, this is a basic example that shows you how to implement the CDO mailer object in Classic ASP, hope this helps, it’ll help me every once in awhile, there are still a lot of sites using classic ASP.
<%
' Set contents of email body
body = "Thank you for your interest in LandersWeb.com Web 2.0 site overhaul. We'll contact you shortly. Please call us at 1-503-347-4515"
Dim objCDOMail
Set objCDOMail = Server.CreateObject("CDO.Message")
objCDOMail.From = "Kevin Landers" & "
objCDOMail.To = “Recipient Name” & “
objCDOMail.Subject = “Web Development test email”
objCDOMail.TextBody = body ‘body is a variable that is set above
objCDOMail.Bcc = “Support” & “
‘objCDOMail.Bcc = “Kevin” & “
objCDOMail.Send
Set objCDOMail = Nothing
Response.Redirect “http://www.LandersWeb.com” ‘ I usually don’t redirect the, rather I show a message
%>
Tags: ASP tip, CDOMail, Classic ASP, email, send mail, web development