By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,026 Members | 2,085 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,026 IT Pros & Developers. It's quick & easy.

VBScript compilation error '800a0401'

P: 1
Microsoft VBScript compilation error '800a0401'

Expected end of statement

/forms/lgctest.asp, line 17

Expand|Select|Wrap|Line Numbers
  1. Dim name,municipal position,municipality,address,city,state,zip,email
  2.  
  3. here's my code
  4.  
  5. <%@LANGUAGE= "VBSCRIPT"%>
  6. <%Option Explicit%>
  7. <html>
  8. <body>
  9.  
  10. <%
  11.  
  12. 'NOTE: YOU MUST UPDATE THE FOLLOWING 3 VARIABLES
  13. Dim strMailDomain, strMailUserName, strMailPassword
  14.  
  15. strMailDomain = "mail.southerntierwest.org"
  16. strMailUserName = "sphearsdorf@southerntierwest.org"
  17. strMailPassword = "phearsdorf"
  18.  
  19.  
  20. ' Get the form data from HTML form with 8 fields
  21. Dim name,municipal position,municipality,address,city,state,zip,email
  22.  
  23. name= Request.Form("txt_name")
  24. name= Request.Form("txt_municipal position")
  25. name= Request.Form("txt_municipality")
  26. name= Request.Form("txt_address")
  27. name= Request.Form("txt_city")
  28. name= Request.Form("txt_state")
  29. name= Request.Form("txt_zip")
  30. name= Request.Form("txt_email")
  31.  
  32.  
  33. ' Create the JMail message Object
  34. Dim msg
  35. set msg = Server.CreateOBject( "JMail.Message" )
  36.  
  37.  
  38. ' Enter the sender data
  39. msg.From = senderEmail
  40. msg.FromName = name
  41.  
  42. 'Server Authentication
  43. msg.MailServerUserName = strMailUserName
  44. msg.MailServerPassWord = strMailPassword
  45.  
  46.  
  47.  
  48. ' Note that as addRecipient is method and not
  49. ' a property, we do not use an equals ( = ) sign
  50. msg.AddRecipient "sphearsdorf@southerntierwest.org"
  51.  
  52. ' The subject of the message
  53. msg.Subject = subject
  54.  
  55. ' And the body
  56. msg.body = body
  57.  
  58.  
  59.  
  60. ' Now send the message, using the indicated mailserver
  61. if not msg.Send(strMailDomain) then
  62. Response.write "<pre>" & msg.log & "</pre>"
  63. else
  64. 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"
  65. end if
  66.  
  67.  
  68. ' That's it - you can add additional e-mail addresses as required.
  69.  
  70.  
  71. %>
Mar 5 '10 #1
Share this Question
Share on Google+
2 Replies


tlhintoq
Expert 2.5K+
P: 3,525
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.
Mar 5 '10 #2

sashi
Expert 100+
P: 1,754
Hi Sarah,

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

Expand|Select|Wrap|Line Numbers
  1.   msg.AddRecipient("sphearsdorf@southerntierwest.org")
  2.  
Mar 7 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.