[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1466
  • Last Modified:

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

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
tldrio
Asked:
tldrio
  • 2
1 Solution
 
HilaireCommented:
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
 
HilaireCommented:
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
 
tldrioAuthor Commented:
Thank you.  That solved that error.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now