I am getting the error below, and I don't know why:
Microsoft VBScript compilation error '800a03f6'
Expected 'End'
/staff/email_staff_thanks.asp, line 66
Hee is my code (I bolded line 66):
<%
if (Request.Form("emailto")) = "Alan Wenrich" then
var emailto="alanwenrich@zluth.org"
if (Request.Form("emailto")) = "Donna Ebright" then
var emailto="dce@zluth.org"
if (Request.Form("emailto")) = "JoAnne Beadencup" then
var emailto="jbeadencup@lss-elca.org"
if (Request.Form("emailto")) = "Kathy Cracraft" then
var emailto="office@zluth.org"
if (Request.Form("emailto")) = "Bennett Williams" then
var emailto="wmakemesmile@aol.com"
if (Request.Form("emailto")) = "Craig Fesig" then
var emailto="office@zluth.org"
if (Request.Form("emailto")) = "Zion's Web Team" then
var emailto="webmaster@zluth.org"
if (Request.Form("emailto")) = "Marsha Roscoe" then
var emailto="marsharoscoe@zluth.org"
end if
%>
<%
Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.FromName = "Zion Lutheran Church"
Mailer.FromAddress = "office@zluth.org"
Mailer.RemoteHost = "localhost"
Mailer.AddRecipient Request.Form("Fname ") & Request.Form("Lname"), Request.Form("Email")
Mailer.Subject = "Zion Lutheran Church Email Staff"
Mailer.BodyText = Request.Form("Fname") & Request.Form("Lname") & "," & Chr(13) & Chr(13) & "Thank you for your email. If your request warrants a response, I will respond as soon as posible." & Chr(13) & Chr(13) & "Thank you for visiting http://www.zluth.org" & Chr(13) & Request.Form("emailto")
if Mailer.SendMail then
else
Response.Write "Mail send failure. Error was " & Mailer.Response
end if
%>
<html>
<head>
<title>Zion Evangelical Lutheran Church - Email Staff Thanks</title>
<!--#include virtual="/inc/head_include.htm"-->
</head>
<body bgcolor="#FFFFFF" marginheight="0" marginwidth="0" leftmargin="0" topmargin="0" background="/images/background2.jpg" onLoad="init()">
<table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr>
<td rowspan="4" valign="top">
<!--#include virtual="/inc/Menu.htm" -->
</td>
<td colspan="2" valign="top">
<!--#include virtual="/inc/layout_top.asp"--><br>
</td>
</tr>
<tr>
<td valign="top">
<table width="100%" border="1" cellspacing="0" cellpadding="5" bordercolor="330099" bgcolor="ffffff" valign="top">
<tr>
<td>
<%
Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.FromName = Request.Form("Name ") & Request.Form("Lname")
Mailer.FromAddress = Request.Form("Email")
Mailer.RemoteHost = "localhost"
Mailer.AddRecipient Request.Form("emailto"), Request.Form("emailto")
Mailer.Subject = Request.Form("subject")
Mailer.BodyText = Request.Form("emailto") & Chr(13) & Chr(13) & Request.Form("Comments") & Chr(13) & Chr(13) & Request.Form("Fname ") & Request.Form("Lname")
if Mailer.SendMail then
Response.Write (" Your request has been processed. Thank you, " & Mailer.FromName & ", for your email. Please use the links on the left side or below to navigate throughout our site.")
else
Response.Write ("Mail send failure. Error was " & Mailer.Response) end if
%>
hi,
it is expecting the 'END' Statement to all your IF statments you have made.
you Can have the following
If then
If then
If then
If then
End If
Each if statement needs and 'End If' unless you make use of elseif like so
if (Request.Form("emailto")) = "Alan Wenrich" then
var emailto="alanwenrich@zluth.org"
elseif (Request.Form("emailto")) = "Donna Ebright" then
var emailto="dce@zluth.org"
elseif (Request.Form("emailto")) = "JoAnne Beadencup" then
var emailto="jbeadencup@lss-elca.org"
elseif (Request.Form("emailto")) = "Kathy Cracraft" then
var emailto="office@zluth.org"
elseif (Request.Form("emailto")) = "Bennett Williams" then
var emailto="wmakemesmile@aol.com"
elseif (Request.Form("emailto")) = "Craig Fesig" then
var emailto="office@zluth.org"
elseif(Request.Form("emailto")) = "Zion's Web Team" then
var emailto="webmaster@zluth.org"
elseif (Request.Form("emailto")) = "Marsha Roscoe" then
var emailto="marsharoscoe@zluth.org"
end if
Bookmarks