Classic ASP – Sending Mail using CDO

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” & “” ‘ Copy Email
‘objCDOMail.Bcc = “Kevin” & “” ‘Blind Copy Email
objCDOMail.Send
Set objCDOMail = Nothing
Response.Redirect “http://www.LandersWeb.com” ‘ I usually don’t redirect the, rather I show a message
%>

17 Responses to “Classic ASP – Sending Mail using CDO”

  1. Mary Says:

    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!


  2. How I Make $5000 a Month Posting Links on Google Says:

    Loved your latest post, by the way.


  3. Zoran Says:

    Hello,
    Where are you from? Is it a secret? :)
    Thank you
    Zoran


  4. buy_vigrxplus Says:

    Great post! I’ll subscribe right now wth my feedreader software!


  5. electromozzo Says:

    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.


  6. Zashkaser Says:

    Thanks for writing, I very much liked your newest post. I think you should post more frequently, you evidently have natural ability for blogging!


  7. LenaShopogolik Says:

    I bookmarked this link. Thank you for good job!


  8. Sdanektir Says:

    Nice site. go to my favorites. TNx


  9. dimagromovfoto Says:

    Very interesting site. Hope it will always be alive!


  10. znak Says:

    Thanks for post


  11. Bill Bartmann Says:

    Excellent site, keep up the good work


  12. Bill Bartmann Says:

    Great site…keep up the good work.


  13. bdsm Says:

    Great site. Keep doing


  14. indian Says:

    It is the coolest site, keep so


  15. gaybdsm Says:

    Awesome!


  16. femdom Says:

    Thx


  17. feetblog Says:

    thank you soooooo much for this


Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>