Current location: Hot Scripts Forums » Programming Languages » ASP » asp Formmail script not working


asp Formmail script not working

Reply
  #1 (permalink)  
Old 09-21-05, 12:55 PM
VBSformmailglitch VBSformmailglitch is offline
New Member
 
Join Date: Sep 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Smile asp Formmail script not working

Calling all VBScript-ers,

I am trying to use a formmail script to process a form on my website. I got the script from http://www.brainjar.com/asp/formmail/default2.asp and I thought I had replaced the necessary variables to make it work. I uploaded the form "emailform.htm" to my site, made a folder named "scripts" and put the formmail.asp file there, but when I press the submit button in the form, I get the following:



Microsoft VBScript compilation error '800a0400'

Expected statement

/scripts/formmail.asp, line 15
\
^

{my browser reads: http://www.strykerart.com/scripts/formmail.asp}



I assume I have made a mistake with line 15, the form action part?
Here's the form code:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

</head>

<body>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="Layer1" style="position:absolute; left:70px; top:108px; width:548px; height:396px; z-index:1">
<p>If you would like to be informed about new art and exhibitions, receive our annual catalogue, or leave a message, email us using the form below. All information will be reserved for strykerart use only. </p>
<form action="/scripts/formmail.asp" method="post">
</p>
<input name="_recipients" type="hidden" value="sally@strykerart.com">
<input name="_redirect" type="hidden" value="thankyou.htm">
<input name="_replyToField" type="hidden" value="email">
<input name="_subject" type="hidden" value="site feedback">
<input name="_requiredFields" type="hidden" value="firstname, lastname, email">
<input name="_fieldOrder" type="hidden" value="firstname, lastname, city, state, zip, email, figure, water, florals, upcoming, message">
<input name="_envars" type="hidden" value="HTTP_REFERRER,




I have googled this error number, but have not found an answer yet. If anyone could help me with this, I would be so grateful! Thank you and I look forward to hearing from you.

Sincerely,
Sally
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 10-13-05, 06:52 PM
koncept
Guest
 
Posts: n/a
the form action is correct, assuming the file you want to post to is there. the error is on the formmail.asp page. if you could post line 15 from there can probaly help you out more.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 10-14-05, 10:41 AM
zippo04 zippo04 is offline
New Member
 
Join Date: Oct 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
I think koncept is right,you should post the wrong line,and some body can reply you~
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 10-26-05, 06:13 AM
stevepugh stevepugh is offline
Newbie Coder
 
Join Date: Oct 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
The Form Method should be "GET" I think.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 10-26-05, 07:02 AM
toth toth is offline
Newbie Coder
 
Join Date: Oct 2005
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
What kind of mailing script are you using. CDONTS, CDOSYS, JMAIL or ASPMAIL?? Are you also working with a database?

Here is a CDONTS sample with a few options:

Your mail form page, I called it MyMail.asp

HTML Code:
<form action="cdonts_form.asp" method="post" name="MyForm" id="MyForm">
<table width="500" border="1" cellspacing="1" cellpadding="2">
<tr>
<td width="135"><strong>First Name</strong></td>
<td width="348"><input name="firstname" type="text" id="firstname" size="30"></td>
</tr>
<tr>
<td><strong>Last Name </strong></td>
<td><input name="lastname" type="text" id="lastname" size="30"></td>
</tr>
<tr>
<td><strong>Email Address </strong></td>
<td><input name="email" type="text" id="email" size="30"></td>
</tr>
<tr>
<td><strong>Sex</strong></td>
<td>Male 
<input name="sex" type="radio" value="Male" checked> 
| Female 
<input name="sex" type="radio" value="Female"></td>
</tr>
<tr>
<td><strong>Colours Required </strong></td>
<td>Red 
<input name="colour1" type="checkbox" id="colour1" value="Red">
| Blue 
<input name="colour2" type="checkbox" id="colour2" value="Blue "> 
| Green 
<input name="colour3" type="checkbox" id="colour3" value="Green"></td>
</tr>
<tr>
<td><strong>Comments</strong></td>
<td><textarea name="comments" cols="28" rows="6" wrap="VIRTUAL" id="comments"></textarea></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<input type="submit" name="Submit" value="Send">
</div></td>
</tr>
</table>
</form>
and the ASP mail script, I called it cdonts_form.asp:

ASP Code:
  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
  2. <%
  3. 'First lets Dim all the variables we need
  4. Dim MyMail
  5. Dim MyBody
  6. Dim MyEmail
  7. Dim MyFirstname
  8. Dim MyLastname
  9. Dim MySex
  10. Dim MyColour1
  11. Dim MyColour2
  12. Dim MyColour3
  13. Dim MyComments
  14. 'Now lets get some values for the variables from the form
  15. MyEmail = Request.Form("email")
  16. MyFirstname = Request.Form("firstname")
  17. MyLastname = Request.Form("lastname")
  18. MySex = Request.Form("sex")
  19. MyColour1 = Request.Form("colour1")
  20. MyColour2 = Request.Form("colour2")
  21. MyColour3 = Request.Form("colour3")
  22. MyComments = Request.Form("comments")
  23.  
  24. 'Now lets build the body of the email from the data in the form
  25. MyBody = "First Name: "& MyFirstName & vbcrlf
  26. MyBody = MyBody & "Last Name: "& MyLastName & vbcrlf
  27. MyBody = MyBody & "Email: "& MyEmail & vbcrlf
  28. MyBody = MyBody & "Sex: "& MySex & vbcrlf & vbcrlf
  29. MyBody = MyBody & "Colour 1: "& MyColour1 & vbcrlf
  30. MyBody = MyBody & "Colour 2: "& MyColour2 & vbcrlf
  31. MyBody = MyBody & "Colour 3: "& MyColour3 & vbcrlf & vbcrlf
  32. MyBody = MyBody & "Comments:" & vbcrlf
  33. MyBody = MyBody & MyComments
  34. 'Now lets put the variables and other information we need into the mailing script
  35. Set MyMail = Server.CreateObject ("CDONTS.NewMail")
  36. MyMail.From = MyEmail
  37. MyMail.To = "You@YourEmailAddress.co.uk"
  38. MyMail.Subject = "Test email using CDONTS"
  39. MyMail.Body = MyBody
  40. MyMail.Send
  41. set MyMail=nothing
  42. Response.Write("Your e-mail has been sent")
  43. %>

greetz, toth

Last edited by UnrealEd; 03-26-07 at 07:48 AM. Reason: please use the correct code syntax highlighters
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Raffle/Lottery Script (Very profitable!), Coded it myself. Voltaire General Advertisements 6 03-16-09 08:15 AM
2 profitable script sites for sale cms-master.com General Advertisements 3 07-03-07 11:17 AM
PHP script problem (please help) osmanmumtaz PHP 0 05-24-05 08:29 AM
URGENT help needed $$$ - Formmail script avalon Job Offers & Assistance 0 05-22-05 09:16 PM
Is there any integrity of script rankings? webmaster@atmanager.com Hot Scripts Forum Questions, Suggestions and Feedback 17 08-06-04 01:12 AM


All times are GMT -5. The time now is 03:51 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.