Understanding how CDO works
Hi
All help is gratefully received.
I have run into what I am sure has a simple solution. In a simple feedback page I was using the the objCDONTS to creat an email function to a generic email account for feedback. We were running windows 2000 and that worked well. Now have migrated to a win 2003 server the objCDONTS is not supported. I have read through various articles on changing the object to CDO but this is not working:
My code below adapts the objcdo but this does not work. I would be grateful for a solution.
Dim objCDO ' Email object
Dim strFromName ' From persons' real name
Dim strFromUnit ' from division
Dim strFromLocation ' from building location
Dim strFromTeleNum ' from telephone number
Dim strCheckBox ' from checkbox -
Dim strFromEmail, strToEmail, strBcEmail ' Email addresses
Dim strSubject, strBody ' Message
Dim misccompo
strSubject = "Getting Involved - Feedback"
strFromName = Trim(Request.Form("name"))
strFromUnit = Trim(Request.Form("unit"))
strFromLocation = Trim(Request.Form("location"))
strFromTeleNum = Trim(Request.Form("telenum"))
strFromEmail = Trim(Request.Form("email"))
strOptList = Trim(Request.Form("optlist"))
strCheckBox = Trim(Request.Form("checkbox"))
strToEmail = "email address goes here"
strBccEmail = "email address goes here"
strBody = Trim(Request.Form("message"))
Set objCDO = Server.CreateObject("CDONTS.NewMail")
objCDO.From = strFromName & " <" & strFromEmail & ">"
objCDO.To = strToEmail
objCDO.BCc = strBccEmail
objCDO.Subject = strSubject
objCDO.Body = "--------------------------------------------------------------" & vbcrlf & vbcrlf & "GENERATED FROM GETTING INVOLVED FEEDBACK FORM contact.asp" & vbcrlf & vbcrlf & "name: " & strFromName & vbcrlf & "Unit: " & strFromUnit & vbcrlf & "Location: " & strFromLocation & vbcrlf & "Telephone: " & strFromTeleNum & vbcrlf & "Selected from list: " & strOptList & vbcrlf & vbcrlf & "to be seen by the Permanent Secretary: " & strCheckBox & vbcrlf & vbcrlf & strbody & vbcrlf & vbcrlf & vbcrlf & "--------------------------------------------------------------" & vbcrlf & "MESSAGE ENDS: End of message"
objCDO.Send
Set objCDO = Nothing
response.redirect "thanks.asp"
response.end
%>
Thanks again for your help.
Kind regards
|