leprkn
08-28-2003, 05:48 PM
i'm trying to create a form that submits data via e-mail using CDO my code is as follows:
dim strName, strAddress, strPhone, strUnfAddress, strEmail, objCDOMail
if request.ServerVariables("CONTENT_LENGTH") <> 0 then
strName = trim(request.Form("name"))
strUnfAddress = trim(request.Form("address"))
strPhone = trim(request.Form("phone"))
strEmail = trim(request.Form("email"))
strAddress = replace(strUnfAddress, vbcrlf, "<br>" & vbcrlf)
' set objNewMessage = Server.CreateObject("CDONTS.NewMail")
' objNewMessage.Send strEmail, "ryan@ididntdoit.net", strName & strEmail & strAddress & strPhone
' Create NewMail object
Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
' Set the properties of the object
objCDOMail.From = strEmail
objCDOMail.To = "ryan@ididntdoit.net"
objCDOMail.Subject = "support request"
'body text
mailBody = strName & strEmail & strAddress & strPhone
objCDOMail.Body = mailBody
' Send the message
objCDOMail.Send
Set objCDOMail = Nothing
%>
there's more code to the page, an else statement that displays the form which is working fine
when i submit the form, i get an error on line 17 of my code (Set objCDOMail = Server.CreateObject("CDONTS.NewMail") ) of invalid class string. can anyone help?
dim strName, strAddress, strPhone, strUnfAddress, strEmail, objCDOMail
if request.ServerVariables("CONTENT_LENGTH") <> 0 then
strName = trim(request.Form("name"))
strUnfAddress = trim(request.Form("address"))
strPhone = trim(request.Form("phone"))
strEmail = trim(request.Form("email"))
strAddress = replace(strUnfAddress, vbcrlf, "<br>" & vbcrlf)
' set objNewMessage = Server.CreateObject("CDONTS.NewMail")
' objNewMessage.Send strEmail, "ryan@ididntdoit.net", strName & strEmail & strAddress & strPhone
' Create NewMail object
Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
' Set the properties of the object
objCDOMail.From = strEmail
objCDOMail.To = "ryan@ididntdoit.net"
objCDOMail.Subject = "support request"
'body text
mailBody = strName & strEmail & strAddress & strPhone
objCDOMail.Body = mailBody
' Send the message
objCDOMail.Send
Set objCDOMail = Nothing
%>
there's more code to the page, an else statement that displays the form which is working fine
when i submit the form, i get an error on line 17 of my code (Set objCDOMail = Server.CreateObject("CDONTS.NewMail") ) of invalid class string. can anyone help?