Solved

Microsoft VBScript compilation error '800a03f6',  Expected 'End'

Posted on 2003-11-12
3
1,444 Views
Last Modified: 2012-06-21
Firstly, I am not a web designer by any means.  My company has a 3rd party do the design and well apparently they don't know exactly what they are doing.  I have been fixing the designers page erroes on every *.asp page he sends, but I don't have a clue how to rectify this one:

Microsoft VBScript compilation error '800a03f6'

Expected 'End'

/inquiry.asp, line 32


The designer added lines 10-22.  Since this addition, I get the above error.  Any suggestions?


Here is a complete copy of the coding:

<%
   Set Mail = Server.CreateObject("Persits.MailSender")
   Mail.Host = "smtp_gw.oceanelectric.net; smtp.oceanelectric.net"
   Mail.From = "test@testing-AspMail-do-not-reply.com"
   Mail.FromName = "inquiry"
   Mail.AddAddress Request("recipient")
   Mail.Subject = Request("Subject")
   Mail.Body = Request("body")

For Each Item in Request.Form
strMsgInfo = strMsgInfo & Item & ": " & Request.Form(Item) & vbCrLf
Next

strMsgHeader = "Form information follows:" & vbCrLf
strMsgHeader = strMsgHeader & "*************" & vbCrLf
strMsgFooter = "*************"


Mailer.BodyText = strMsgHeader & strMsgInfo & strMsgFooter

If Mailer.SendMail Then
Set Mailer = Nothing

      strErr = ""
      bSuccess = False
      On Error Resume Next ' catch errors
      Mail.Send      ' send message
      If Err <> 0 Then ' error occurred
                  strErr = Err.Description
      else
                  bSuccess = True
      End If
%>

<center>
            <table width=760>
               <tr>
                  <td bgcolor=FFFFFF>
                     <table width=760 cellpadding=0 cellspacing=0>
                        <tr>
                           <td valign=top bgcolor=#282C68>
                               <table>
                                  <tr>
                                     <td colspan=2 valign=bgcolor=#282C68>
                                        <img src=images/header.jpg alt="About Ocean Electric" width="760" height="120">
                                     </td>
                                  </tr>
                                  <tr>
                                     <td valign=top width=160>
   <SCRIPT LANGUAGE = "JavaScript">
<!--
    if (document.images) {
//
    img000over = new Image();
    img000over.src = "mo/nav-on000.gif";
    img001over = new Image();
    img001over.src = "mo/nav-on001.gif";
    img002over = new Image();
    img002over.src = "mo/nav-on002.gif";
    img003over = new Image();
    img003over.src = "mo/nav-on005.gif";
    img004over = new Image();
    img004over.src = "mo/nav-on003.gif";
    img005over = new Image();
    img005over.src = "mo/nav-on004.gif";
//
    img000out = new Image();
    img000out.src = "mo/nav-off000.gif";
    img001out = new Image();
    img001out.src = "mo/nav-off001.gif";
    img002out = new Image();
    img002out.src = "mo/nav-off002.gif";
    img003out = new Image();
    img003out.src = "mo/nav-off005.gif";
    img004out = new Image();
    img004out.src = "mo/nav-off003.gif";
    img005out = new Image();
    img005out.src = "mo/nav-off004.gif";
}

// Function to show active images.
function imgOver(imgName) {
    if (document.images) {
        document[imgName].src = eval(imgName + "over.src");
    }
}

// Function to show inactive images.
function imgOut(imgName) {
    if (document.images) {
        document[imgName].src = eval(imgName + "out.src");
    }
}

// -->
</SCRIPT>

<img src=images/house-left.jpg width="160" height="128">
<br>
<TABLE CELLSPACING = 0 CELLPADDING = 0 BORDER = 0>
<!-- Table starts with a dummy row to force correct cell widths -->
<!-- Each row starts with a dummy to force correct cell heights -->
<TR><TD WIDTH = 0 HEIGHT = 0></TD><TD WIDTH = 180 HEIGHT = 0></TD></TR><TR><TD WIDTH = 0 HEIGHT = 31></TD><TD><A HREF = "about.html" onMouseOver = "imgOver('img000')" onMouseOut = "imgOut('img000')"><IMG
NAME = "img000" SRC = "mo/nav-off000.gif" BORDER = 0 width="180" height="31"></A></TD></TR><TR><TD WIDTH = 0 HEIGHT = 29></TD><TD><A HREF = "securenet.html" target=_blank onMouseOver = "imgOver('img001')" onMouseOut = "imgOut('img001')"><IMG
NAME = "img001" SRC = "mo/nav-off001.gif" BORDER = 0 width="180" height="29"></A></TD></TR><TR><TD WIDTH = 0 HEIGHT = 29></TD><TD><A HREF = "http://www.garagetek.com" target=_blank onMouseOver = "imgOver('img003')" onMouseOut = "imgOut('img003')"><IMG
NAME = "img003" SRC = "mo/nav-off005.gif" BORDER = 0 WIDTH = 180 HEIGHT = 29></A></TD></TR><TR><TD WIDTH = 0 HEIGHT = 31></TD><TD><a HREF="http://www.oceanelectric.net/contact.html" onMouseOver="imgOver('img004')" onMouseOut="imgOut('img004')"><IMG
NAME = "img004" SRC = "mo/nav-off003.gif" BORDER = 0 width="180" height="31"></a></TD></TR><TR><TD WIDTH = 0 HEIGHT = 33></TD><TD><A HREF = "index.html" onMouseOver = "imgOver('img005')" onMouseOut = "imgOut('img005')"><IMG
NAME = "img005" SRC = "mo/nav-off004.gif" BORDER = 0 width="180" height="33"></A></TD></TR></TABLE>
                                 </td>
                                 <td valign=top bgcolor=#FFFFFF>
                                    <font face=arial,helvetica size=-1>
                                       <blockquote>
                                       <br>
                                       <b>Thank you for your inquiry! An Ocean Electric sales representative will contact you shortly.
                                       </blockquote>

                              <center>

                                    <img src=images/logo-sm.gif width="137" height="44">
                                       <font size=-2 face=arial,helvetica>
                                          <br>
                                             99 Mariner Drive<br>
                                             Southampton, NY 11968<br>
                                             Phone: (631) 287-6060 Fax: (631) 287-0731
                                          <br>
                                          <br>
                                       </font>
                                 </td>
                              </tr>
                           </table>
                        </td>
                     </tr>
                  </table>
               </td>
            </tr>
         </table>
0
Comment
Question by:tldrio
  • 2
3 Comments
 
LVL 26

Accepted Solution

by:
Hilaire earned 500 total points
Comment Utility
Lacking "End If" statement just before the first "%>"

<%
   Set Mail = Server.CreateObject("Persits.MailSender")
   Mail.Host = "smtp_gw.oceanelectric.net; smtp.oceanelectric.net"
   Mail.From = "test@testing-AspMail-do-not-reply.com"
   Mail.FromName = "inquiry"
   Mail.AddAddress Request("recipient")
   Mail.Subject = Request("Subject")
   Mail.Body = Request("body")

For Each Item in Request.Form
strMsgInfo = strMsgInfo & Item & ": " & Request.Form(Item) & vbCrLf
Next

strMsgHeader = "Form information follows:" & vbCrLf
strMsgHeader = strMsgHeader & "*************" & vbCrLf
strMsgFooter = "*************"


Mailer.BodyText = strMsgHeader & strMsgInfo & strMsgFooter

If Mailer.SendMail Then
Set Mailer = Nothing

     strErr = ""
     bSuccess = False
     On Error Resume Next ' catch errors
     Mail.Send     ' send message
     If Err <> 0 Then ' error occurred
               strErr = Err.Description
     else
               bSuccess = True
     End If
End If
%>


HTH

Hilaire
0
 
LVL 26

Expert Comment

by:Hilaire
Comment Utility
Hi, there are a few things that sound odd in the code you posted.

You'll find working examples using this free email-sending component at this URL
http://www.aspemail.com/manual_02.html

You'll also find links to download the last version of this free component
http://www.aspemail.com/download.html

The last versions come with a setup exe so you don't even have to register it manually.

<%
   Dim strMsgBody
   Set Mail = Server.CreateObject("Persits.MailSender")
   Mail.Host = "smtp_gw.oceanelectric.net; smtp.oceanelectric.net"
   Mail.From = "test@testing-AspMail-do-not-reply.com"
   Mail.FromName = "inquiry"
   Mail.AddAddress Request("recipient")
   Mail.Subject = Request("Subject")
   strMsgBody = "Form information follows:" & vbCrLf & "*************" & vbCrLf
   'Build Msg Body
   For Each Item in Request.Form
      strMsgBody = strMsgBody & Item.Name & ": " & Request.Form(Item).value & vbCrLf
   Next
   strMsgBody = strMsgBody & "*************"

   Mail.Body = strMsgBody
   strErr = ""
   bSuccess = False
   On Error Resume Next ' catch errors
   Mail.Send     ' send message
   If Err <> 0 Then ' error occurred
             strErr = Err.Description
   else
             bSuccess = True
   End If
   set Mail = Nothing
%>

The code above is a revised version of yours.
- mailer object not used any more
- consistent variable names

Hilaire


0
 

Author Comment

by:tldrio
Comment Utility
Thank you.  That solved that error.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Dynamic? Dropdown Box 29 69
Upload a file using ASP Classic 20 49
EOF BOF error classic asp 8 28
Age between date range query (SP) 13 45
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now