Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - VB Script Runtime Error
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

VB Script Runtime Error

 Post Reply Post Reply
Author
bluepearl View Drop Down
Newbie
Newbie
Avatar

Joined: 21 November 2005
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote bluepearl Quote  Post ReplyReply Direct Link To This Post Topic: VB Script Runtime Error
    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/
' 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
' -- execute confirmation page
Response.Redirect "
http://www.carnarvonarms.com/thankyou.htm"
%>
Back to Top
Scott07 View Drop Down
Groupie
Groupie


Joined: 04 July 2002
Location: United Kingdom
Status: Offline
Points: 43
Post Options Post Options   Thanks (0) Thanks(0)   Quote Scott07 Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.