View Full Version : need help With an asp form processor

jonathan theake
06-14-2007, 05:17 PM
hey guys im trying to get jamil to rmail me the results of a form its all working fine but the email it sends is blank, im a bit of a novice at this so any help would be great.

this is my form (wandshop.asp)


<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
<base target="_self">

<body bgcolor="#9FD08F">

<form method="POST" action="get.asp">
<p><font color="#4C6C54" face="Arial"><b>Which type of wood would you like ?</b> <select size="1" name="D1">
<option>Silver Birch</option>
<p><b><font face="Arial" color="#4C6C54">Which Tip ? </font></b> </p>
<p><font face="Arial"><font color="#4C6C54">Pointed Tip&nbsp; <input type="checkbox" name="C1" value="ON"></font><a href="../../images/tip%20(1).JPG"><font color="#4C6C54"><a target="_blank" href="../../images/tip%20(1).JPG"><img border="0" src="tip%20(1)_small.JPG" xthumbnail-orig-image="../../images/tip (1).JPG"></a></font></a></a></font></p>
<p><font face="Arial"><font color="#4C6C54">Rounded Tip<input type="checkbox" name="C2" value="ON"></font><a href="../../images/tip%20(2).JPG"><font color="#4C6C54"><a target="_blank" href="../../images/tip%20(2).JPG"><img border="0" src="tip%20(2)_small.JPG" xthumbnail-orig-image="../../images/tip (2).JPG"></a></font></a></font></p>
<p><font face="Arial"><font color="#4C6C54">Flat Tip&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="checkbox" name="C3" value="ON"></font><a href="../../images/tip.JPG"><font color="#4C6C54"><a target="_blank" href="../../images/tip.JPG"><img border="0" src="tip_small.JPG" xthumbnail-orig-image="../../images/tip.JPG"></a></font></a></font></p>
<p><b><font face="Arial" color="#4C6C54">Now what would you like at the end
of your hilt ?</font></b></p>
<p><font face="Arial"><font color="#4C6C54">A Flat Pentacle Disk
<input type="checkbox" name="C4" value="ON"></font><a href="../../images/hiltend.JPG"><font color="#4C6C54"><a target="_blank" href="../../images/hiltend.JPG"><img border="0" src="hiltend_small.JPG" xthumbnail-orig-image="../../images/hiltend.JPG"></a></font></a></font></p>
<p><font face="Arial"><font color="#4C6C54">A Rounded End&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="checkbox" name="C5" value="ON"></font><a href="../../images/hiltend%20(1).JPG"><font color="#4C6C54"><a target="_blank" href="../../images/hiltend%20(1).JPG"><img border="0" src="hiltend%20(1)_small.JPG" xthumbnail-orig-image="../../images/hiltend (1).JPG"></a></font></a></font></p>
<p><font face="Arial"><font color="#4C6C54">A Flat End&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="checkbox" name="C6" value="ON"></font><a href="../../images/hiltend%20(3).JPG"><font color="#4C6C54"><a target="_blank" href="../../images/hiltend%20(3).JPG"><img border="0" src="hiltend%20(3)_small.JPG" xthumbnail-orig-image="../../images/hiltend (3).JPG"></a></font></a></font></p>
<p><font face="Arial"><font color="#4C6C54">A Flat Slanted End&nbsp;&nbsp;&nbsp;
<input type="checkbox" name="C7" value="ON"></font><a href="../../images/hiltend%20(2).JPG"><font color="#4C6C54"><a target="_blank" href="../../images/hiltend%20(2).JPG"><img border="0" src="hiltend%20(2)_small.JPG" xthumbnail-orig-image="../../images/hiltend (2).JPG"></a></font></a></font></p>
<p><font face="Arial"><font color="#4C6C54">A Carved Ball&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="checkbox" name="C8" value="ON"></font><a href="../../images/hiltend%20(4).JPG"><font color="#4C6C54"><a target="_blank" href="../../images/hiltend%20(4).JPG"><img border="0" src="hiltend%20(4)_small.JPG" xthumbnail-orig-image="../../images/hiltend (4).JPG"></a></font></a></font></p>
<p><b><font face="Arial" color="#4C6C54">Which hilt design would you like ?</font></b></p>
<p><font face="Arial"><font color="#4C6C54">Four Grooves And Plain&nbsp;
<input type="checkbox" name="C9" value="ON"></font><a href="../../images/hilt.JPG"><font color="#4C6C54"><a target="_blank" href="../../images/hilt.JPG"><img border="0" src="hilt_small.JPG" xthumbnail-orig-image="../../images/hilt.JPG"></a></font></a></font></p>
<p><font face="Arial"><font color="#4C6C54">Large Groove And Spiral<input type="checkbox" name="C10" value="ON"></font><a href="../../images/hilt%20(1).JPG"><font color="#4C6C54"><a target="_blank" href="../../images/hilt%20(1).JPG"><img border="0" src="hilt%20(1)_small.JPG" xthumbnail-orig-image="../../images/hilt (1).JPG"></a></font></a></font></p>
<p><font face="Arial" color="#4C6C54">Two Flats With Design </font>&nbsp;&nbsp;&nbsp;
<input type="checkbox" name="C11" value="ON"><a target="_blank" href="../../images/hilt%20(2).JPG"><img border="0" src="hilt%20(2)_small.JPG" xthumbnail-orig-image="../../images/hilt (2).JPG"></a></p>
<p><font color="#4C6C54" face="Arial"><input type=submit value=Submit name="Redeem"></font></i></form>


And this is my form processor (Get.asp)

Dim d1name,d1,c1name,c1,c2name,c2,c3name,c3,c4name,c4,c5name,c5,c6name,c6,c7name,c7,c8name,c8,c9name,c9, c10name,c10,c11name,c11
d1name = "Which Wood"
d1 = Request.Form("d1")
c1name = "Pointed Tip"
c1 = Request.Form("c1")
c2name = "Rounded Tip"
c2 = Request.Form("c2")
c3name = "Flat Tip"
c3 = Request.Form("c3")
c4name = "A Flat Pentacle Disk"
c4 = Request.Form("c4")
c5name = "A Rounded End"
c5 = Request.Form("c5")
c6name = "A Flat End"
c6 = Request.Form("c6")
c7name = "A Flat Slanted End"
c7 = Request.Form("c7")
c8name = "A Carved Ball"
c8 = Request.Form("c8")
c9name = "Four Grooves And Plain"
c9 = Request.Form("c9")
c10name = "Large Groove And Spiral"
c10 = Request.Form("c10")
c11name = "Two Flats With Design"
c11 = Request.Form("c11")
Set JMail = Server.CreateObject("JMail.SMTPMail")
'Change this line to the address of your
'email server. Something like this: mail.yoursite.com:25
JMail.ServerAddress = "mail.thewitchespanty.co.uk"

JMail.AddRecipient "requests@thewitchespantry.co.uk"
'in the next line you can change that email address to something else
'like "myform@myurl.com", just be sure and put it between quotes " "
JMail.Sender = "requests@thewitchespantry.co.uk"
'you can also change "Form Submission" to something else like "form results" etc.
JMail.Subject = "Wand Purchase From Wand Shop"
JMail.Body = d1name & vbcrlf&_
d1 & vbcrlf&_
c1name & vbcrlf&_
c1 & vbcrlf&_
c2name & vbcrlf&_
c2 & vbcrlf&_
c3name & vbcrlf&_
c3 & vbcrlf&_
c4name & vbcrlf&_
c4 & vbcrlf&_
c5name & vbcrlf&_
c5 & vbcrlf&_
c6name & vbcrlf&_
c6 & vbcrlf&_
c7name & vbcrlf&_
c7 & vbcrlf&_
c8name & vbcrlf&_
c8 & vbcrlf&_
c9name & vbcrlf&_
c9 & vbcrlf&_
c10name & vbcrlf&_
c10 & vbcrlf&_
c11name & vbcrlf&_
c11 & vbcrlf&_

please Help me make it work

06-14-2007, 05:41 PM
You have too many &_ in your code.

Change your second to last line:

c11 & vbcrlf '<<<< THIS IS THE CHANGE

For later on, you may want to write out the Email Body so that you can see it before it goes out.


c11 & vbcrlf '<<<< THIS IS THE CHANGE
response.write Body

To send the mail, comment out the response.write and response.flush and Uncomment the JMail.Execute and the Response.redirect.


jonathan theake
06-14-2007, 05:56 PM
thanks alot that works fine now just need to add a few more text input boxes when i have does the second to last line need to remain

c11 & vbcrlf '<<<< THIS IS THE CHANGE

without the &_


06-14-2007, 06:01 PM
When you add the last few input boxes, you need to add the &_ to all but the very last line.

So, how ever many fields you add, always remember that the line above JMail.Execute needs to NOT have the concatenator ( &_ ).

If you are ever unsure, just run the RESPONSE.WRITE code to see if it gives you any errors.