dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: Email help

  1. #1
    Join Date
    Jan 2003
    Location
    PA
    Posts
    1,898

    Email help

    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
    %>

    </td>
    </tr>
    </table>
    <tr>
    <td><p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    </td>
    </tr>
    </tr>
    </td>
    <tr>
    <td colspan="2" valign="top">
    <!--#include virtual="../inc/layout_bottom.htm"-->
    </td>
    </tr>

    </td>
    </tr>
    </table>
    </body>
    </html>

  2. #2
    Join Date
    Jan 2003
    Location
    Dundee, Scotland
    Posts
    1,367
    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

    Hope this helps.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles