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
June 24th, 2009 at 1:48 am
Pretty good post. I just found your blog and wanted to say
that I have really liked reading your blog posts. Anyway
I’ll be subscribing to your blog and I hope you post again soon!
June 25th, 2009 at 9:18 pm
Loved your latest post, by the way.
July 3rd, 2009 at 6:49 am
Hello,
Where are you from? Is it a secret?
Thank you
Zoran
July 15th, 2009 at 1:40 am
Great post! I’ll subscribe right now wth my feedreader software!
July 31st, 2009 at 1:51 pm
Just wanted to say HI. I found your blog a few days ago on Technorati and have been reading it over the past few days.
August 5th, 2009 at 10:45 pm
Thanks for writing, I very much liked your newest post. I think you should post more frequently, you evidently have natural ability for blogging!
August 6th, 2009 at 8:49 am
I bookmarked this link. Thank you for good job!
August 6th, 2009 at 6:22 pm
Nice site. go to my favorites. TNx
August 16th, 2009 at 6:15 am
Very interesting site. Hope it will always be alive!
August 17th, 2009 at 10:31 am
Thanks for post
September 2nd, 2009 at 2:49 pm
Excellent site, keep up the good work
September 4th, 2009 at 11:33 am
Great site…keep up the good work.
September 19th, 2009 at 2:30 pm
Great site. Keep doing
September 19th, 2009 at 11:10 pm
It is the coolest site, keep so
September 21st, 2009 at 2:06 am
Awesome!
September 21st, 2009 at 11:36 am
Thx
September 23rd, 2009 at 9:05 am
thank you soooooo much for this