473,765 Members | 2,159 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

email form won't submit

3 New Member
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 2826
thesmithman
37 New Member
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
jennifer6601
3 New Member
Thank you! I'll give that a try and let you know if it worked!
May 17 '10 #3
jennifer6601
3 New Member
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
2251
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 'back' button, the user can change his/her input. If no errors are found, the input is used to generate some graphics (using the gdlib.so module). When running this script on my own Linux/Apache/PHP/gdlib.so server, it works perfectly. But...
6
4044
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 on it... (Kinda like a menu, you make your choice from) But since this table can get very long, I've put something of a 'search-form' on top, which enables the user to make a
2
3630
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 html for my form. If anyone could help, that'd be greatly appreciated. <form action="http://www.mcfedries.com/mailform/mailform.asp" method="POST"> <input type=hidden name="MFAddress" value="My email address"> <input type=hidden name="MFCode"...
1
1686
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 is the name of the seminar they are registering for, their name and email address. My problem is that all the seminars are listed in a table and I am assuming I'll have to create multiple forms to go with each seminar. What's the best way to do...
8
4487
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. Is there anyway to tell? Here's the code. It sends me email fine, but when it's on her ISP, it says it sent the mail, but nothing goes through. <?php if (isset($submit)) { switch ($recipient) { case "whole-family":
23
3239
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 to say either "thank you," in the same window and then close it. Or do something else, that the user knows his form has been submitted. The pop up window that says "thank you" can have a close link on it. I do not need to refresh the parent page or...
3
1897
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 being relayed directly to my email. This is the code, and thanks in advance!: <div id="form"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <form action="MAILTO:ruth@ruthpiazzon.com" method="post" enctype="text/plain">
0
1461
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 varSend:URLRequest = new URLRequest("http://www.xxxx.contactus.aspx"); var varLoader:URLLoader = new URLLoader; varSend.method = URLRequestMethod.POST; varSend.data = variables; stop();
2
3056
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 I do? Thanks, James
0
9568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9398
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10156
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10007
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7375
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3924
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3531
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2805
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.