Hi all,
Please help. I am trying to get asp email to work at the moment and keep getting the error below. I am new to the whole thing as I am used to using a form mail.pl script usually. Can ayone help or point me in the right direction please?
Microsoft VBScript runtime error '800a01ad'
ActiveX component can't create object: 'CDONTS.NewMail'
/send_it.asp, line 47
I have attached my code below if it helps. Thankyou for your help.
MY SCRIPT
<%@ Language=VBScript %>
<%
Option Explicit
%>
<%
' -----------------------------------------------------
' CDONTS Email send script
' © http://www.designplace.org/' Comments must remain intact for re-use of this code
' -----------------------------------------------------
dim strfirstname, strsurname, strtelephone, stremail, strcomments
strfirstname = Request.Form("firstname") ' holds inputted name
strsurname = Request.Form("surname") ' holds inputted surname
strtelephone = Request.Form("telephone") ' holds inputted telephone
stremail = Request.Form("email") ' holds inputted email address
strcomments = Request.Form("comments") ' holds inputted comments
' -- check all fields for empty values --
' -- remove and add new as required --
if strfirstname = "" then
Response.Redirect "contact.asp?action=err1"
else if strsurname = "" then
Response.Redirect "contact.asp?action=err2"
else if strtelephone = "" then
Response.Redirect "contact.asp?action=err3"
else if stremail = "" then
Response.Redirect "contact.asp?action=err4"
else if strcomments = "" then
Response.Redirect "contact.asp?action=err5"
end if
end if
end if
end if
end if
' -- begin email send process --
dim objMail
Set objMail = CreateObject("CDONTS.NewMail")
' -- email variables --
objMail.To = "info@bluepearlsolutions.com"
objMail.From = Trim(stremail)
objMail.Subject = "Enquiry Form"
objMail.BodyFormat = "0" ' HTML format
objMail.Body = "Name: " & Trim(strfirstname) & vbCrLf _
& "Surname: " & Trim(strsurname) & vbCrLf _
& "Telephone: " & Trim(strtelephone) & vbCrLf _
& "E-Mail Address: " & Trim(stremail) & vbCrLf _
& "Comments: " & Trim(strcomments)
' -- send the email --
objMail.Send
' -- clean up object
Set objMail = Nothing