Return to iWEBTOOL

Go Back   iWEBTOOL Talk > The Web and your Website > Programming > HTML > JavaScript
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
 
Welcome to iWEBTOOL Talk, where you talk about webmaster-related stuff.
 
Discuss topics which interest you.
With over thousands of threads (topics), we're sure you'll find something that'll interest you.
Ask for help whenever you need it.
We have thousands of members who are available to help you if you need it.
It's absolutely FREE!

 1  Register           2  Browse the board           3  Discuss whatever may interest you!
 


Reply
 
Thread Tools Search this Thread Display Modes
Old 03-14-2008, 03:44 PM   #1
Mamba
Smurf
 
Mamba's Avatar
 
Join Date: Feb 2008
Posts: 2
Mamba is on a distinguished road
Default MS VBScript Error

Hi,

I wounder if somone could help i'm getting the following error when trying to submit a form

Microsoft VBScript runtime error '800a01f4'

Variable is undefined: 'oMail'

/SubmitCatalogueRequest.asp, line 4

Many thanks David.
Mamba is offline   Reply With Quote
 
This is an Ad Revenue Sharing forum Place your advert here
SEO Checklist
Get yourself better ranking with
our "Do-it-Yourself" SEO Checklist.
Click Here
Old 03-14-2008, 09:38 PM   #2
Alan
iWEBTOOL Moderator
 
Alan's Avatar
 
Join Date: Nov 2006
Location: Ayr, Scotland
Posts: 904
Alan has a spectacular aura aboutAlan has a spectacular aura about
Default Re: MS VBScript Error

I assume your attempting to run an asp page.

This error usually means that a variable has been created, but has not been defined with a dim statement. Often this includes ADO constants, such as adOpenForwardOnly and adLockOptimistic.
__________________

ahb Solutions Consultancy and Web Development

Seen a good post - Give some reputation click on the
Alan is offline   Reply With Quote
Old 03-15-2008, 11:15 AM   #3
Mamba
Smurf
 
Mamba's Avatar
 
Join Date: Feb 2008
Posts: 2
Mamba is on a distinguished road
Default Re: MS VBScript Error

Hi I'm working on a site created by someone else, i'm very new to ASP.

here is the code:

<% Option Explicit %>
<%

Set oMail = Server.CreateObject("CDO.Message")
Set oMailConfig = Server.CreateObject ("CDO.Configuration")

oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
oMailConfig.Fields.Update

'set the mail parameters
sMessage = "The following catalogue request has been sent via the MWS Website:" & chr(13) & chr(10) & chr(13) & chr(10)

sMessage = sMessage & "Name: " & request.form.item("name") & chr(13) & chr(10) & chr(13) & chr(10)
sMessage = sMessage & "Address: " & request.form.item("address") & chr(13) & chr(10) & chr(13) & chr(10)
sMessage = sMessage & "Telephone Number: " & request.form.item("telephone") & chr(13) & chr(10) & chr(13) & chr(10)

sFrom = request.form.item("emailAddress")
sMessage = sMessage & "Email address: " & sFrom & chr(13) & chr(10) & chr(13) & chr(10)

Set oMail.Configuration = oMailConfig
oMail.From = "mwsWebsite@mwsltd.co.uk"
oMail.To = "sales@mwsltd.co.uk"
oMail.Subject = "MWS Catalogue Request Form"
oMail.HTMLBody = sMessage
oMail.Send

Set oMail = Nothing
Set oMailConfig = Nothing
response.redirect("Confirmation.asp")

Many thanks for the help
Mamba is offline   Reply With Quote
Old 03-15-2008, 05:45 PM   #4
Alan
iWEBTOOL Moderator
 
Alan's Avatar
 
Join Date: Nov 2006
Location: Ayr, Scotland
Posts: 904
Alan has a spectacular aura aboutAlan has a spectacular aura about
Default Re: MS VBScript Error

By default, Microsoft's VBScript lets you implicitly declare variables in your code. You have <% Option Explicit %> at the top of your code, the <% OPTION EXPLICIT %> function to require that all variables be declared first.

I use a similar routine and do not use <% Option Explicit %>, try removing this as a first step, failing that you need to define the variable, use Dim = oMail before the Set oMail = ...
__________________

ahb Solutions Consultancy and Web Development

Seen a good post - Give some reputation click on the
Alan is offline   Reply With Quote
 
This is an Ad Revenue Sharing forum Place your advert here
Webmaster Tools Webmaster Tools Click Here
Reply



Quick Reply
Message:

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
University.ms stevefrancis711 Domains for Sale 0 10-18-2007 10:53 PM
Simple stupid question for MS Frontpage website-submit.org HTML 4 03-30-2007 05:51 PM
sexz.ms ? New Member 1rst post ZEROB41 Domain Appraisals 0 03-25-2007 08:30 AM
Hello from MS, USA Johnni Introduce yourself 5 12-13-2006 09:19 PM
Website Content Databases - MySQL & MS Access odditysoftware Websites for Sale 115 11-28-2006 09:19 PM


All times are GMT. The time now is 08:18 AM.


Powered by vBulletin v3.6.7 © 2008, Jelsoft Enterprises Ltd. SEO by vBSEO © 2006, Crawlability, Inc.