Print Page | Close Window

VB Script Runtime Error

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=17303
Printed Date: 29 March 2026 at 5:07pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: VB Script Runtime Error
Posted By: bluepearl
Subject: VB Script Runtime Error
Date Posted: 21 November 2005 at 10:33am
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/ - 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 = "
mailto:info@bluepearlsolutions.com - 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
' -- execute confirmation page
Response.Redirect "
http://www.carnarvonarms.com/thankyou.htm - http://www.carnarvonarms.com/thankyou.htm "
%>



Replies:
Posted By: Scott07
Date Posted: 25 November 2005 at 3:28pm
That error normally means the CDONTS component has been disabled or removed, are you using a windows 98 pws or a windows 2003 server or are you using a free web host?

Also as a good coding pratice you should put your code to do the work nested in the if's or as a private function which is called from inside the ifs because at first glance it would appear there is two distinct chunks of code there and I would consider spitting them to make them simpler to read at a later date however, the second parts is highly dependant on the first part bing run.


-------------
http://www.worldsofwar.co.uk - Worlds of War II



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net