VBScript compilation error '800a0401'

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sarahj
    New Member
    • Mar 2010
    • 1

    VBScript compilation error '800a0401'

    Microsoft VBScript compilation error '800a0401'

    Expected end of statement

    /forms/lgctest.asp, line 17

    Code:
    Dim name,municipal position,municipality,address,city,state,zip,email
    
    here's my code
    
    <%@LANGUAGE= "VBSCRIPT"%>
    <%Option Explicit%>
    <html>
    <body>
    
    <%
    
    'NOTE: YOU MUST UPDATE THE FOLLOWING 3 VARIABLES
    Dim strMailDomain, strMailUserName, strMailPassword
    
    strMailDomain = "mail.southerntierwest.org"
    strMailUserName = "sphearsdorf@southerntierwest.org"
    strMailPassword = "phearsdorf"
    
    
    ' Get the form data from HTML form with 8 fields
    Dim name,municipal position,municipality,address,city,state,zip,email
    
    name= Request.Form("txt_name")
    name= Request.Form("txt_municipal position")
    name= Request.Form("txt_municipality")
    name= Request.Form("txt_address")
    name= Request.Form("txt_city")
    name= Request.Form("txt_state")
    name= Request.Form("txt_zip")
    name= Request.Form("txt_email")
    
    
    ' Create the JMail message Object
    Dim msg
    set msg = Server.CreateOBject( "JMail.Message" )
    
    
    ' Enter the sender data
    msg.From = senderEmail
    msg.FromName = name
    
    'Server Authentication
    msg.MailServerUserName = strMailUserName
    msg.MailServerPassWord = strMailPassword
    
    
    
    ' Note that as addRecipient is method and not
    ' a property, we do not use an equals ( = ) sign
    msg.AddRecipient "sphearsdorf@southerntierwest.org"
    
    ' The subject of the message
    msg.Subject = subject
    
    ' And the body
    msg.body = body
    
    
    
    ' Now send the message, using the indicated mailserver
    if not msg.Send(strMailDomain) then
    Response.write "<pre>" & msg.log & "</pre>"
    else
    Response.write "Change this content to your own thank you message: Thank you for taking the time to contact us. We will review your request as soon as possible and reply accordingly"
    end if
    
    
    ' That's it - you can add additional e-mail addresses as required.
    
    
    %>
    Last edited by tlhintoq; Mar 5 '10, 07:18 PM. Reason: [CODE] ...Your code goes between code tags [/CODE]
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    TIP: When you are writing your question, there is a button on the tool bar that wraps the [code] tags around your copy/pasted code. It helps a bunch. Its the button with a '#' on it. More on tags. They're cool. Check'em out.

    Comment

    • sashi
      Recognized Expert Top Contributor
      • Jun 2006
      • 1749

      #3
      Hi Sarah,

      Kindly refer to below modified section. Hope it helps :)

      Code:
        msg.AddRecipient("sphearsdorf@southerntierwest.org")

      Comment

      Working...