473,382 Members | 1,526 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

email form won't submit

Hello. I am new to this forum as well as to ASP and need some help with a simple email form for a website I've developed.

I have a simple html email form that is processed with an ASP script using the POST method, that should redirect to an html thank you page upon successful submission of the form. All three pages currently reside on a server and the site is live, so I am accessing the form from the live website to test it. The ASP script currently uses my own email address for testing purposes. I do not receive the emails, which I'm sure you've figured out.

When I hit the submit button I get an HTTP 500 Internal Error message that says the "Website cannot diplay the page." I've talked to the hosting company and they assure me that permissions are set correctly.

I've been troubleshooting this form for weeks and have gone from specific script/syntax errors to the HTTP 500 server error, and have hit a brick wall. If anyone can tell me what I've done wrong or need to do to fix the script I would greatly appreciate it. Here is my ASP script page...

Expand|Select|Wrap|Line Numbers
  1.  
  2. <%@LANGUAGE="VBSCRIPT"%>
  3. <% 
  4. Dim objConfig  ' As CDO.Configuration
  5. Dim objMessage ' As CDO.Message
  6. Dim Fields     ' As ADODB.Fields
  7. Dim contact, company, email, phone, businessType, comments
  8.  
  9. contact = Request.Form("contact")
  10. company = Request.Form("company")
  11. email = Request.Form("email")
  12. phone = Request.Form("phone")
  13. businessType = Request.Form("businessType")
  14. comments = Request.Form("comments")
  15.  
  16. ' Get a handle on the config object and it's fields
  17. Set objConfig = Server.CreateObject("CDO.Configuration")
  18. Set Fields = objConfig.Fields
  19.  
  20. ' Set config fields we care about
  21.  
  22.     .Item(cdoSMTPServer)            = "mail.xyz.com"
  23.     .Item(cdoSMTPServerPort)        = 25
  24.     .Item(cdoSMTPConnectionTimeout) = 10
  25.     .Item(cdoSMTPAuthenticate)      = cdoBasic
  26.     .Item(cdoSendUserName)          = "emailcontactus@xyz.local"
  27.     .Item(cdoSendPassword)          = "emailus101"
  28.  
  29.  
  30. Set objCDOMail = Server.CreateObject("CDO.NewMail")
  31.  
  32. Set objMessage.Configuration = objConfig
  33.  
  34.  
  35.     objCDOMail.To       = "jennifer@jlpgraffix.com"
  36.     objCDOMail.From     = "contactus@reimbconcepts.com"
  37.     objCDOMail.Subject  = "SMTP Relay Test"
  38.     objCDOMail.HTMLBody = "Contact: " & Request.Form("contact") & vbCrLf & "Company: " & Request.Form("company") & vbCrLf & "Email: " & Request.Form("email") &_
  39.     "Phone: " & Request.Form("phone") & vbCrLf & "BusinessType : " & Request.Form("businessType") & vbCrLf & "Comments: " & Request.Form("comments")
  40.  
  41. objCDOMail.Send
  42.  
  43.  
  44. Set Fields = Nothing
  45. Set objCDOMail = Nothing
  46. Set objConfig = Nothing
  47.  
  48. Response.Redirect "mailSuccess.html"
  49. %>
  50.  
  51.  
Thank you!
May 17 '10 #1
3 2808
Hi Jennifer,
Sounds like a parse error. I'm not a VBscript expert, but if you don't have an error log set up on your server, this is what I would do to find the problem:

Make a copy of the script as it is and save it someplace on your computer.

Edit the version on the server. Delete almost all the code. Don't try to send an e-mail yet; see if you can just output the POST data to the browser. If you're able to submit the form and get the "action" page to display your input text, then you are halfway there.

After that you can re-introduce the rest of your code one line at a time until you get the 500 error again - and that will be the line with the problem!

Again, sorry that's not as specific as you might have hoped but without a better background in VBScript that's the best I can offer.

:)
May 17 '10 #2
Thank you! I'll give that a try and let you know if it worked!
May 17 '10 #3
thesmithman,

Thanks for the help. I got the form working. I all I did was change the server to "localhost" and that was it! Thanks again!
May 20 '10 #4

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

Similar topics

6
by: Martin Herrman | last post by:
Dear scripters, I wrote a PHP script that produces a form. If the form is submitted, the entered information is checked. If an error in the input is found, a message appears. Using the browser's...
6
by: Joop | last post by:
Hi all, I'm kinda new to JavaScript, but hey... I'm trying anyway! ;-) So, here's my problem : I've created a table in my document, presenting a list of items, one can 'select' by clicking...
2
by: alwaysintune | last post by:
I'm using the McFedries email form, and I can't seem to get an upload form to work. Instead of it saving to my server, I want it to send the information and the picture to my email. Here is the...
1
by: KerryK | last post by:
Hi all: I need some help to create an email form that students can submit to register for a seminar. Basically all I want the student to do is to click a submit button but what has to come up for me...
8
by: alice | last post by:
I found this code for making a php email form for a web site. It works fine on my ISP, but not on my friends...could it be that my ISP uses php5, I know that hers does not, so I assume it's php4....
23
by: karen987 | last post by:
I have a form on a html page which one fills in and submits using email. The form has been opened in a pop up page, Once the form has been submitted, (emailed) I need to add some javasript...
3
by: missred | last post by:
Hi All, I'm hoping someone can help me with this problem. the form works ok in firefox and IE6, but when send is pressed, a blank email form or a blank IE7 page comes up, instead of the message...
0
rrocket
by: rrocket | last post by:
I was wondering if anyone has done an email form in flash with a .NET backend (instead of PHP)? For the Flash side I have this: var variables:URLVariables = new URLVariables(); var...
2
by: jamesmoore | last post by:
Hi, I have tried to test my php for ages now but when i test a form and click submit instead of the form data being sent to my email a prompt comes up asing me to open/save the php folder. What do...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.