Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP form - Order amount not coming through on email 1

Status
Not open for further replies.

tinggg

Technical User
May 15, 2004
69
0
0
NZ
Hi

This is my first asp form so please be gentle with me :) It's a publications ordering form. I've got the form and the asp code setup, when the form is sent the name of the publication comes through but not the amount ordered - i'm sure i've made a simple mistake somewhere - can anyone spot why the order amount isn't coming through. Any help is much appreciated.Thank you.

Code:
 <%

' declare variables
Dim EmailFrom
Dim EmailTo
Dim Subject
Dim Name
Dim Organisation
Dim PostalAddress
Dim Email
Dim Workbook
Dim thepayandemploymentequityplanofaction
Dim whatispayandemploymentequity
Dim payandemploymentequityplanofaction
Dim workinginajointemployerunionreviewcommitteeonpayandemploymentequity
Dim thehistoryofpayandemploymentequityinsomewhere
Dim definitionsofpayandemploymentequityterms
Dim payandemploymentequitycontestablefund
Dim frequentlyaskedquestions
Dim payinvestigations
Dim equitablejobevaluation
Dim steeringgroupannualreport
Dim sumdepartmentofCompany
Dim fulldepartmentofCompany
Dim sumeducationreviewoffice
Dim fulleducationreviewoffice
Dim sumstationblue
Dim fullstationblue
Dim equitablejobevaluationtool

' get posted data into variables
EmailFrom = Trim(Request.Form("EmailFrom")) 
EmailTo = "myemail@myemail.com"
Subject = Trim(Request.Form("Subject")) 
Name = Trim(Request.Form("Name")) 
Email = Trim(Request.Form("Email")) 
Organisation = Trim(Request.Form("Organisation")) 
PostalAddress = Trim(Request.Form("PostalAddress")) 
Workbook = Trim(Request.Form("Workbook"))
thepayandemploymentequityplanofaction = Trim(Request.Form("thepayandemploymentequityplanofaction"))
whatispayandemploymentequity = Trim(Request.Form("whatispayandemploymentequity"))
payandemploymentequityplanofaction = Trim(Request.Form("payandemploymentequityplanofaction"))
workinginajointemployerunionreviewcommitteeonpayandemploymentequity = Trim(Request.Form("workinginajointemployerunionreviewcommitteeonpayandemploymentequity"))
thehistoryofpayandemploymentequityinsomewhere = Trim(Request.Form("thehistoryofpayandemploymentequityinsomewhere"))
definitionsofpayandemploymentequityterms = Trim(Request.Form("definitionsofpayandemploymentequityterms"))
payandemploymentequitycontestablefund = Trim(Request.Form("payandemploymentequitycontestablefund"))
frequentlyaskedquestions = Trim(Request.Form("frequentlyaskedquestions"))
payinvestigations = Trim(Request.Form("payinvestigations"))
equitablejobevaluation = Trim(Request.Form("equitablejobevaluation"))
steeringgroupannualreport = Trim(Request.Form("steeringgroupannualreport"))
sumdepartmentofCompany = Trim(Request.Form("sumdepartmentofCompany"))
fulleducationreviewoffice = Trim(Request.Form("fulleducationreviewoffice"))
sumeducationreviewoffice = Trim(Request.Form("sumeducationreviewoffice"))
fulleducationreviewoffice = Trim(Request.Form("fulleducationreviewoffice"))
sumstationblue = Trim(Request.Form("sumstationblue"))
fullstationblue = Trim(Request.Form("fullstationblue"))
equitablejobevaluationtool = Trim(Request.Form("equitablejobevaluationtool"))


' prepare email body text
Dim Body
Body = Body & "Name: " & Name & VbCrLf
Body = Body & "Organisation: " & Organisation & VbCrLf
Body = Body & "Postal Address: " & PostalAddress & VbCrLf
Body = Body & "Email: " & Email & VbCrLf
Body = Body & "Workbook: " & Workbook & VbCrLf
Body = Body & "The Pay and Employment Equity Plan of Action: " & thepayandemploymentequityplanofaction & VbCrLf
Body = Body & "What is Pay and Employment Equity?: " & whatispayandemploymentequity & VbCrLf
Body = Body & "Working in a Joint Employer/Union Review Committee on Pay and Employment Equity: " & workinginajointemployerunionreviewcommitteeonpayandemploymentequity & VbCrLf
Body = Body & "The History of Pay and Employment Equity in some where: " & thehistoryofpayandemploymentequityinsomewhere & VbCrLf
Body = Body & "Definitions of Pay and Employment Equity Terms: " & definitionsofpayandemploymentequityterms & VbCrLf
Body = Body & "Pay and Employment Equity Contestable Fund: " & payandemploymentequitycontestablefund & VbCrLf
Body = Body & "Frequently Asked Questions: " & frequentlyaskedquestions & VbCrLf
Body = Body & "Pay Investigations: " & payinvestigations & VbCrLf
Body = Body & "Equitable Job Evaluation: " & equitablejobevaluation & VbCrLf
Body = Body & "Steering Group Annual Report: " & steeringgroupannualreport & VbCrLf
Body = Body & "Case Study: My Company, Summary: " & sumdepartmentofCompany & VbCrLf
Body = Body & "Case Study: My Company, Full: " & fulldepartmentofCompany & VbCrLf
Body = Body & "Case Study: Education Review Office, Summary: " & sumeducationreviewoffice & VbCrLf
Body = Body & "Case Study: Education Review Office, Full: " & fulleducationreviewoffice & VbCrLf
Body = Body & "Case Study: Station Blue, Summary: " & sumstationblue & VbCrLf
Body = Body & "Case Study: Station Blue, Full: " & fullstationblue & VbCrLf
Body = Body & "Assessment Details: Equitable Job Evaluation Tool: " & equitablejobevaluationtool & VbCrLf


 Set Email = Server.CreateObject("CDO.Message")
 Set EMailConfig = Server.CreateObject("CDO.Configuration") 'calls CDO configuration COM object
 'Set Flds = EmailConfig.Fields
 
 With EmailConfig.Fields
  .Item("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/sendusing")[/URL] = 1 'tells cdo we are using the local smtp service
  .Item("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory")[/URL] = "c:\inetpub\mailroot\pickup" 'verify that this path is correct
  .Update 'updates CDOs configuration
 End With
 
 With Email
  .Configuration = EMailConfig
  .From = "Stuff"
  .Subject = "Stuff From Website"
  .TextBody = body
  .To = "myemail@myemail.com"
  .Send
 End With

 Set EMailConfig = nothing
 Set Email = Nothing
 
 Response.Redirect "orderdone.asp"
%>


Form:

Code:
 <table>
      <tr>
       <td bgcolor="#E0E0E0"><b>Download now?</b></td>
       <td bgcolor="#E0E0E0"><b>Publication title </b></td>
       <td colspan="2" bgcolor="#E0E0E0"><b>How many copies? </b></td>
      </tr>
      <tr>
       <td width="102">Yes</td>
       <td width="338"><label for="workbook">Workbook</label></td>
       <td colspan="2"><input type="text" id="workbook" size="3"/></td>
      </tr>
      <tr>
       <td>Yes</td>
       <td><label for="thepayandemploymentequityplanofaction">The Pay and Employment Equity Plan of Action</label></td>
       <td colspan="2"><input type="text" id="thepayandemploymentequityplanofaction" size="3"/></td>
      </tr>
      <tr>
       <td colspan="4" bgcolor="#E0E0E0"><b>Fact Sheets </b></td>
      </tr>
      <tr>
       <td>Yes</td>
       <td><label for="whatispayandemploymentequity">What is Pay and Employment Equity?</label></td>
       <td colspan="2"><input type="text" id="whatispayandemploymentequity" size="3"/></td>
      </tr>
      <tr>
       <td>Yes</td>
       <td><label for="payandemploymentequityplanofaction">Pay and Employment Equity Plan of Action</label></td>
       <td colspan="2"><input type="text" id="payandemploymentequityplanofaction" size="3"/></td>
      </tr>
      <tr>
       <td>Yes</td>
       <td><label for="workinginajointemployerunionreviewcommitteeonpayandemploymentequity">Working in a Joint Employer/Union Review Committee on Pay and Employment Equity</label></td>
       <td colspan="2"><input type="text" id="workinginajointemployerunionreviewcommitteeonpayandemploymentequity" size="3"/></td>
      </tr>
      <tr>
       <td>Yes</td>
       <td><label for="thehistoryofpayandemploymentequityinsomewhere">The History of Pay and Employment Equity in some where</label>
       </td><td colspan="2"><input type="text" id="thehistoryofpayandemploymentequityinsomewhere" size="3"/></td>
      </tr>
      <tr>
       <td>Yes</td>
       <td><label for="definitionsofpayandemploymentequityterms">Definitions of Pay and Employment Equity Terms</label></td>
       <td colspan="2"><input type="text" id="definitionsofpayandemploymentequityterms" size="3"/></td>
      </tr>
      <tr>
       <td>Yes</td>
       <td><label for="payandemploymentequitycontestablefund ">Pay and Employment Equity Contestable Fund</label></td>
       <td colspan="2"><input type="text" id="payandemploymentequitycontestablefund" size="3"/></td>
      </tr>
      <tr>
       <td>Yes</td>
       <td><label for="frequentlyaskedquestions">Frequently Asked Questions</label></td>
       <td colspan="2"><input type="text" id="frequentlyaskedquestions" size="3"/></td>
      </tr>
      <tr>
       <td>&nbsp;</td>
       <td><label for="payinvestigations">Pay Investigations</label></td>
       <td colspan="2"><input type="text" id="payinvestigations" size="3"/></td>
      </tr>
      <tr>
       <td>Yes</td>
       <td><label for="equitablejobevaluation">Equitable Job Evaluation</label></td>
       <td colspan="2"><input type="text" id="equitablejobevaluation" size="3"/></td>
      </tr>
      <tr>
       <td>Yes</td>
       <td><label for="steeringgroupannualreport">Steering Group Annual Report</label></td>
       <td colspan="2"><input type="text" id="steeringgroupannualreport" size="3"/></td>
      </tr>
      <tr>
       <td colspan="4" bgcolor="#E0E0E0"><b>Case Studies</b><br/>The case studies provide review committees with a further practical resource, alongside the review workbook and the training programmes, of key learnings from organisations that have already conducted reviews. Summary and full case study versions are available.</td>
      </tr>
      <tr>
       <td colspan="2">&nbsp;</td>
       <td width="37">Sum.</td>
       <td width="41">Full</td>
      </tr>
      <tr>
       <td>Yes</td>
       <td><label for="summycompany">My Company</label></td>
       <td><input type="text" id="summycompany" size="3"/></td>
       <td><input type="text" id="fullmycompany" size="3"/></td>
      </tr>
      <tr>
       <td>Yes</td>
       <td><label for="sumeducationreviewoffice">Education Review Office</label></td>
       <td><input type="text" id="sumeducationreviewoffice" size="3"/></td>
       <td><input type="text" id="fulleducationreviewoffice" size="3"/></td>
      </tr>
      <tr>
       <td>Yes</td>
       <td><label for="sumstationblue">Station Blue</label></td>
       <td><input type="text" id="sumstationblue" size="3"/></td>
       <td><input type="text" id="fullstationblue" size="3"/></td>
      </tr>
      <tr>
       <td colspan="4" bgcolor="#E0E0E0"><b>Assessment Tools</b></td>
      </tr>
      <tr>
       <td>Yes</td>
       <td><label for="equitablejobevaluationtool">Equitable Job Evaluation Tool</label></td>
       <td colspan="2"><input type="text" id="equitablejobevaluationtool" size="3"/></td>
      </tr>
     </table>
 
Hi tinggg... I know it's not strict xhtml but asp requires this...

You need to add a name tag to the input elements on your form as well as "ID"

Code:
id="thepayandemploymentequityplanofaction" name="thepayandemploymentequityplanofaction"

Asp request.form is looking for a name.

Nick
 
To follow up on Nick's observations... where is the <form> tag in your HTML?
 
Hi

I made the changes to the form (added name = )and I am still not receiving any input values i.e. when the email comes through there is no value next to the label e.g
Name:
Organisation:
Postal Address:
Email:
Workbook:

Can you spot anything else that may be incorrect? I've also shortened the id's. Many thanks for you help.

Code:
<%

' declare variables
Dim EmailFrom
Dim EmailTo
Dim Subject
Dim Name
Dim Organisation
Dim PostalAddress
Dim Email
Dim Workbook
Dim actionplan
Dim whatpeeu
Dim peeuaction
Dim review
Dim history
Dim definition
Dim fund
Dim faqs
Dim payinvestigations
Dim jobevaluation
Dim annualreport
Dim sumdol
Dim fulldol
Dim sumero
Dim fullero
Dim sumscc
Dim fullscc
Dim jetool

' get posted data into variables
EmailFrom = Trim(Request.Form("EmailFrom")) 
EmailTo = "myemail@myemail.com"
Subject = Trim(Request.Form("Subject")) 
Name = Trim(Request.Form("Name")) 
Email = Trim(Request.Form("Email")) 
Organisation = Trim(Request.Form("Organisation")) 
PostalAddress = Trim(Request.Form("PostalAddress")) 
Workbook = Trim(Request.Form("Workbook"))
actionplan = Trim(Request.Form("actionplan"))
whatpeeu = Trim(Request.Form("whatpeeu"))
peeuaction = Trim(Request.Form("peeuaction"))
review = Trim(Request.Form("review"))
history = Trim(Request.Form("history"))
definition = Trim(Request.Form("definition"))
fund = Trim(Request.Form("fund"))
faqs = Trim(Request.Form("faqs"))
payinvestigations = Trim(Request.Form("payinvestigations"))
jobevaluation = Trim(Request.Form("jobevaluation"))
annualreport = Trim(Request.Form("annualreport"))
sumdol = Trim(Request.Form("sumdol"))
fullero = Trim(Request.Form("fullero"))
sumero = Trim(Request.Form("sumero"))
fullero = Trim(Request.Form("fullero"))
sumscc = Trim(Request.Form("sumscc"))
fullscc = Trim(Request.Form("fullscc"))
jetool = Trim(Request.Form("jetool"))


' prepare email body text
Dim Body
Body = Body & "Name: " & Name & VbCrLf
Body = Body & "Organisation: " & Organisation & VbCrLf
Body = Body & "Postal Address: " & PostalAddress & VbCrLf
Body = Body & "Email: " & Email & VbCrLf
Body = Body & "Workbook: " & Workbook & VbCrLf
Body = Body & "The Pay and Employment Equity Plan of Action: " & actionplan & VbCrLf
Body = Body & "What is Pay and Employment Equity?: " & whatpeeu & VbCrLf
Body = Body & "Working in a Joint Employer/Union Review Committee on Pay and Employment Equity: " & review & VbCrLf
Body = Body & "The History of Pay and Employment Equity in New Zealand: " & history & VbCrLf
Body = Body & "Definitions of Pay and Employment Equity Terms: " & definition & VbCrLf
Body = Body & "Pay and Employment Equity Contestable Fund: " & fund & VbCrLf
Body = Body & "Frequently Asked Questions: " & faqs & VbCrLf
Body = Body & "Pay Investigations: " & payinvestigations & VbCrLf
Body = Body & "Equitable Job Evaluation: " & jobevaluation & VbCrLf
Body = Body & "Steering Group Annual Report: " & annualreport & VbCrLf
Body = Body & "Case Study: MyCompany, Summary: " & sumdol & VbCrLf
Body = Body & "Case Study: MyCompany, Full: " & fulldol & VbCrLf
Body = Body & "Case Study: Education Review Office, Summary: " & sumero & VbCrLf
Body = Body & "Case Study: Education Review Office, Full: " & fullero & VbCrLf
Body = Body & "Case Study: Blue Station, Summary: " & sumscc & VbCrLf
Body = Body & "Case Study: Blue Station, Full: " & fullscc & VbCrLf
Body = Body & "Assessment Details: Equitable Job Evaluation Tool: " & jetool & VbCrLf


	Set Email = Server.CreateObject("CDO.Message")
	Set EMailConfig = Server.CreateObject("CDO.Configuration") 'calls CDO configuration COM object
	'Set Flds = EmailConfig.Fields
	
	With EmailConfig.Fields
		.Item("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/sendusing")[/URL] = 1 'tells cdo we are using the local smtp service
		.Item("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory")[/URL] = "c:\inetpub\mailroot\pickup" 'verify that this path is correct
		.Update 'updates CDOs configuration
	End With
	
	With Email
		.Configuration = EMailConfig
		.From = "Stuff"
		.Subject = "Stuff From Website"
		.TextBody = body
		.To = "myemail@myemail.com"
		.Send
	End With

	Set EMailConfig = nothing
	Set Email = Nothing
	
	Response.Redirect "orderdone.asp"
%>


Form

Code:
<div class="feedback">
				<form action="sendorder.asp" method="get" name="frmInput">
					<table>
						<tr>
							<td bgcolor="#E0E0E0"><b>Download now?</b></td>
							<td bgcolor="#E0E0E0"><b>Publication title </b></td>
							<td colspan="2" bgcolor="#E0E0E0"><b>How many copies? </b></td>
						</tr>
						<tr>
							<td width="102">Yes</td>
							<td width="338"><label for="workbook">Workbook</label></td>
							<td colspan="2"><input type="text" id="workbook" name="workbook" size="3"/></td>
						</tr>
						<tr>
							<td>Yes</td>
							<td><label for="actionplan">The Pay and Employment Equity Plan of Action</label></td>
							<td colspan="2"><input type="text" id="actionplan" name="actionplan" size="3"/></td>
						</tr>
						<tr>
							<td colspan="4" bgcolor="#E0E0E0"><b>Fact Sheets </b></td>
						</tr>
						<tr>
							<td>Yes</td>
							<td><label for="whatpeeu">What is Pay and Employment Equity?</label></td>
							<td colspan="2"><input type="text" id="whatpeeu" name="whatpeeu" size="3"/></td>
						</tr>
						<tr>
							<td>Yes</td>
							<td><label for="peeuaction">Pay and Employment Equity Plan of Action</label></td>
							<td colspan="2"><input type="text" id="peeuaction" name="peeuaction" size="3"/></td>
						</tr>
						<tr>
							<td>Yes</td>
							<td><label for="review">Working in a Joint Employer/Union Review Committee on Pay and Employment Equity</label></td>
							<td colspan="2"><input type="text" id="review" name="review" size="3"/></td>
						</tr>
						<tr>
							<td>Yes</td>
							<td><label for="history">The History of Pay and Employment Equity in New Zealand</label>
							</td><td colspan="2"><input type="text" id="history" name="history" size="3"/></td>
						</tr>
						<tr>
							<td>Yes</td>
							<td><label for="definition">Definitions of Pay and Employment Equity Terms</label></td>
							<td colspan="2"><input type="text" id="definition" name="definition" size="3"/></td>
						</tr>
						<tr>
							<td>Yes</td>
							<td><label for="fund ">Pay and Employment Equity Contestable Fund</label></td>
							<td colspan="2"><input type="text" id="fund" name="fund" size="3"/></td>
						</tr>
						<tr>
							<td>Yes</td>
							<td><label for="faqs">Frequently Asked Questions</label></td>
							<td colspan="2"><input type="text" id="faqs" name="faqs" size="3"/></td>
						</tr>
						<tr>
							<td>&nbsp;</td>
							<td><label for="payinvestigations">Pay Investigations</label></td>
							<td colspan="2"><input type="text" id="payinvestigations" name="payinvestigations"  size="3"/></td>
						</tr>
						<tr>
							<td>Yes</td>
							<td><label for="jobevaluation">Equitable Job Evaluation</label></td>
							<td colspan="2"><input type="text" id="jobevaluation" name="jobevaluation" size="3"/></td>
						</tr>
						<tr>
							<td>Yes</td>
							<td><label for="annualreport">Steering Group Annual Report</label></td>
							<td colspan="2"><input type="text" id="annualreport" name="annualreport" size="3"/></td>
						</tr>
						<tr>
							<td colspan="4" bgcolor="#E0E0E0"><b>Case Studies</b><br/>The case studies provide review committees with a further practical resource, alongside the review workbook and the training programmes, of key learnings from organisations that have already conducted reviews. Summary and full case study versions are available.</td>
						</tr>
						<tr>
							<td colspan="2">&nbsp;</td>
							<td width="37">Sum.</td>
							<td width="41">Full</td>
						</tr>
						<tr>
							<td>Yes</td>
							<td><label for="sumdol">MyCompany</label></td>
							<td><input type="text" id="sumdol" name="sumdol" size="3"/></td>
							<td><input type="text" id="fulldol" name="fulldol" size="3"/></td>
						</tr>
						<tr>
							<td>Yes</td>
							<td><label for="sumero">Education Review Office</label></td>
							<td><input type="text" id="sumero" name="sumero" size="3"/></td>
							<td><input type="text" id="fullero" name="fullero" size="3"/></td>
						</tr>
						<tr>
							<td>Yes</td>
							<td><label for="sumscc">Blue Station</label></td>
							<td><input type="text" id="sumscc" name="sumscc" size="3"/></td>
							<td><input type="text" id="fullscc" name="fullscc" size="3"/></td>
						</tr>
						<tr>
							<td colspan="4" bgcolor="#E0E0E0"><b>Assessment Tools</b></td>
						</tr>
						<tr>
							<td>Yes</td>
							<td><label for="jetool">Equitable Job Evaluation Tool</label></td>
							<td colspan="2"><input type="text" id="jetool" name="jetool" size="3"/></td>
						</tr>
					</table>
					<table width="400">
						<tr>
							<th colspan="2" align="left" valign="top" bgcolor="#E0E0E0">Your Details</th>
						</tr>
						<tr>
							<th width="150" align="left" valign="top"><label for="name">Name:</label></th>
							<td><input type="text" size="40" id="name" name="name"/></td>
						</tr>
						<tr>
							<th width="150" align="left" valign="top"><label for="organisation">Organisation:</label></th>
							<td><input type="text" size="40" id="organisation" name="organisation"/></td>
						</tr>
						<tr>
							<th width="150" align="left" valign="top"><label for="postaladdress">Postal Address:</label></th>
							<td><textarea rows="5" id="postaladdress" name="postaladdress" cols="30"></textarea></td>
						</tr>
						<tr>
							<th width="150" align="left" valign="top"><label for="email">Email:</label></th>
							<td><input type="text" size="40" id="email" name="email"/></td>
						</tr>
						<tr>
							<td colspan="2" align="left" valign="top"><br/><input name="submit" type="submit" value="s e n d   o r d e r"/>
							&nbsp;</td>
						</tr>
					</table>
				</form>
				
			</div>
 
tinggg, your form method should be post if your using request.form.

Code:
<form action="sendorder.asp" method="[COLOR=red]post[/color]" name="frmInput">

You are currently passing all your variables via the url and so in order to retrieve these you would have to use request.querystring, however for the amount of info you are passing I would stick with posting.

Nick
 
nickdel - thank you thank you thank you

I can't tell you how many days i've spent on this form and it now working!!!!

sincere thanks
T
 
Oh no, I thought it was fixed when I changed the form action to "post" - it worked once but now, the email aren't even coming through - can anyone see the problem? Thanks again

FORM Code

Code:
 <div class="feedback">
				<form action="sendorder.asp" method="post" name="frmInput">
					<table>
						<tr>
							<td bgcolor="#E0E0E0"><b>Download now?</b></td>
							<td bgcolor="#E0E0E0"><b>Publication title </b></td>
							<td colspan="2" bgcolor="#E0E0E0"><b>How many copies? </b></td>
						</tr>
						<tr>
							<td><a href="/services/PayAndEmploymentEquity/resources/action-plan-booklet.pdf">Yes</a></td>
							<td><label for="actionplan">The Pay and Employment Equity Plan of Action</label></td>
							<td colspan="2"><input type="text" id="actionplan" name="actionplan" size="3"/></td>
						</tr>
						<tr>
							<td colspan="4" bgcolor="#E0E0E0"><b>Fact Sheets </b></td>
						</tr>
						<tr>
							<td><a href="/services/PayAndEmploymentEquity/resources/fact-sheets/factsheet-1-what-is-pee-ed3.pdf">Yes</a></td>
							<td><label for="whatpeeu">What is Pay and Employment Equity?</label></td>
							<td colspan="2"><input type="text" id="whatpeeu" name="whatpeeu" size="3"/></td>
						</tr>
						<tr>
							<td><a href="/services/PayAndEmploymentEquity/resources/fact-sheets/factsheet-2-pee-plan-of-action-ed3.pdf">Yes</a></td>
							<td><label for="peeuaction">Pay and Employment Equity Plan of Action</label></td>
							<td colspan="2"><input type="text" id="peeuaction" name="peeuaction" size="3"/></td>
						</tr>
						<tr>
							<td><a href="/services/PayAndEmploymentEquity/resources/fact-sheets/factsheet-3-joint-working-ed3.pdf">Yes</a></td>
							<td><label for="review">Working in a Joint Employer/Union Review Committee on Pay and Employment Equity</label></td>
							<td colspan="2"><input type="text" id="review" name="review" size="3"/></td>
						</tr>
						<tr>
							<td><a href="/services/PayAndEmploymentEquity/resources/fact-sheets/factsheet-4-history-of-pee-in-nz-ed2.pdf">Yes</a></td>
							<td><label for="history">The History of Pay and Employment Equity in New Zealand</label>							</td><td colspan="2"><input type="text" id="history" name="history" size="3"/></td>
						</tr>
						<tr>
							<td><a href="/services/PayAndEmploymentEquity/resources/fact-sheets/factsheet-5-definitions-ed3.pdf">Yes</a></td>
							<td><label for="definition">Definitions of Pay and Employment Equity Terms</label></td>
							<td colspan="2"><input type="text" id="definition" name="definition" size="3"/></td>
						</tr>
						<tr>
							<td><a href="/services/PayAndEmploymentEquity/resources/fact-sheets/factsheet-6-pee-contestable-fund-ed3.pdf">Yes</a></td>
							<td><label for="fund ">Pay and Employment Equity Contestable Fund</label></td>
							<td colspan="2"><input type="text" id="fund" name="fund" size="3"/></td>
						</tr>
						<tr>
							<td><a href="/services/PayAndEmploymentEquity/resources/fact-sheets/factsheet-7-pdf-faq.pdf">Yes</a></td>
							<td><label for="faqs">Frequently Asked Questions</label></td>
							<td colspan="2"><input type="text" id="faqs" name="faqs" size="3"/></td>
						</tr>
						<tr>
							<td><a href="/services/PayAndEmploymentEquity/resources/fact-sheets/factsheet-8-pay-investigations.pdf">Yes</a></td>
							<td><label for="payinvestigations">Pay Investigations</label></td>
							<td colspan="2"><input type="text" id="payinvestigations" name="payinvestigations"  size="3"/></td>
						</tr>
						<tr>
							<td><a href="/services/PayAndEmploymentEquity/resources/fact-sheets/factsheet-9-equitable-job-evaluation.pdf">Yes</a></td>
							<td><label for="jobevaluation">Equitable Job Evaluation</label></td>
							<td colspan="2"><input type="text" id="jobevaluation" name="jobevaluation" size="3"/></td>
						</tr>
						<tr>
							<td><a href="/services/PayAndEmploymentEquity/news/reports/peeu-annual-report-05-06.pdf">Yes</a></td>
							<td><label for="annualreport">Steering Group Annual Report 05/06 </label></td>
							<td colspan="2"><input type="text" id="annualreport" name="annualreport" size="3"/></td>
						</tr>
						<tr>
							<td colspan="4" bgcolor="#E0E0E0"><b>Case Studies</b><br/>The case studies provide review committees with a further practical resource, alongside the review workbook and the training programmes, of key learnings from organisations that have already conducted reviews. Summary and full case study versions are available.</td>
						</tr>
						<tr>
							<td colspan="2">&nbsp;</td>
							<td width="37">Sum.</td>
							<td width="41">Full</td>
						</tr>
						<tr>
							<td><a href="/services/PayAndEmploymentEquity/resources/case-studies/dol-full.pdf">Yes</a></td>
							<td><label for="sumdol">MyCompany</label></td>
							<td><input type="text" id="sumdol" name="sumdol" size="3"/></td>
							<td><input type="text" id="fulldol" name="fulldol" size="3"/></td>
						</tr>
						<tr>
							<td><a href="/services/PayAndEmploymentEquity/resources/case-studies/ero-full.pdf">Yes</a></td>
							<td><label for="sumero">Education Review Office</label></td>
							<td><input type="text" id="sumero" name="sumero" size="3"/></td>
							<td><input type="text" id="fullero" name="fullero" size="3"/></td>
						</tr>
						<tr>
							<td><a href="/services/PayAndEmploymentEquity/resources/case-studies/ssc-full.pdf">Yes</a></td>
							<td><label for="sumscc">Blue Station</label></td>
							<td><input type="text" id="sumscc" name="sumscc" size="3"/></td>
							<td><input type="text" id="fullscc" name="fullscc" size="3"/></td>
						</tr>
						<tr>
							<td colspan="4" bgcolor="#E0E0E0"><b>Assessment Tools</b></td>
						</tr>
						<tr>
							<td width="102"><a href="/services/PayAndEmploymentEquity/resources/assessment-tools/workbook.asp">Yes</a></td>
							<td width="338"><label for="workbook">Workbook</label></td>
							<td colspan="2"><input type="text" id="workbook" name="workbook" size="3"/></td>
						</tr>
						<tr>
							<td><a href="/services/PayAndEmploymentEquity/resources/eje-guidelines.asp">Yes</a></td>
							<td><label for="jetool">Equitable Job Evaluation Information</label></td>
							<td colspan="2"><input type="text" id="jetool" name="jetool" size="3"/></td>
						</tr>
					</table>
					<table width="400">
						<tr>
							<th colspan="2" align="left" valign="top" bgcolor="#E0E0E0">Your Details</th>
						</tr>
						<tr>
							<th width="150" align="left" valign="top"><label for="name">Name:</label></th>
							<td><input type="text" size="40" id="name" name="name"/></td>
						</tr>
						<tr>
							<th width="150" align="left" valign="top"><label for="organisation">Organisation:</label></th>
							<td><input type="text" size="40" id="organisation" name="organisation"/></td>
						</tr>
						<tr>
							<th width="150" align="left" valign="top"><label for="postaladdress">Postal Address:</label></th>
							<td><textarea rows="5" id="postaladdress" name="postaladdress" cols="30"></textarea></td>
						</tr>
						<tr>
							<th width="150" align="left" valign="top"><label for="email">Email:</label></th>
							<td><input type="text" size="40" id="email" name="email"/></td>
						</tr>
						<tr>
							<td colspan="2" align="left" valign="top"><br/><input name="submit" type="submit" value="s e n d   o r d e r"/>
							&nbsp;</td>
						</tr>
					</table>
				</form>
			  <p>
					<br/>
				</p>
			</div>

POST CODE

Code:
 <%

' declare variables
Dim EmailFrom
Dim EmailTo
Dim Subject
Dim Name
Dim Organisation
Dim PostalAddress
Dim Email
Dim Workbook
Dim actionplan
Dim whatpeeu
Dim peeuaction
Dim review
Dim history
Dim definition
Dim fund
Dim faqs
Dim payinvestigations
Dim jobevaluation
Dim annualreport
Dim sumdol
Dim fulldol
Dim sumero
Dim fullero
Dim sumscc
Dim fullscc
Dim jetool

' get posted data into variables
EmailFrom = Trim(Request.Form("EmailFrom")) 
EmailTo = "myemail@myemail.com"
Subject = Trim(Request.Form("Subject")) 
Name = Trim(Request.Form("Name")) 
Email = Trim(Request.Form("Email")) 
Organisation = Trim(Request.Form("Organisation")) 
PostalAddress = Trim(Request.Form("PostalAddress")) 
Workbook = Trim(Request.Form("Workbook"))
actionplan = Trim(Request.Form("actionplan"))
whatpeeu = Trim(Request.Form("whatpeeu"))
peeuaction = Trim(Request.Form("peeuaction"))
review = Trim(Request.Form("review"))
history = Trim(Request.Form("history"))
definition = Trim(Request.Form("definition"))
fund = Trim(Request.Form("fund"))
faqs = Trim(Request.Form("faqs"))
payinvestigations = Trim(Request.Form("payinvestigations"))
jobevaluation = Trim(Request.Form("jobevaluation"))
annualreport = Trim(Request.Form("annualreport"))
sumdol = Trim(Request.Form("sumdol"))
fullero = Trim(Request.Form("fullero"))
sumero = Trim(Request.Form("sumero"))
fullero = Trim(Request.Form("fullero"))
sumscc = Trim(Request.Form("sumscc"))
fullscc = Trim(Request.Form("fullscc"))
jetool = Trim(Request.Form("jetool"))


' prepare email body text
Dim Body
Body = Body & "Name: " & Name & VbCrLf
Body = Body & "Organisation: " & Organisation & VbCrLf
Body = Body & "Postal Address: " & PostalAddress & VbCrLf
Body = Body & "Email: " & Email & VbCrLf
Body = Body & "Workbook: " & Workbook & VbCrLf
Body = Body & "The Pay and Employment Equity Plan of Action: " & actionplan & VbCrLf
Body = Body & "What is Pay and Employment Equity?: " & whatpeeu & VbCrLf
Body = Body & "Working in a Joint Employer/Union Review Committee on Pay and Employment Equity: " & review & VbCrLf
Body = Body & "The History of Pay and Employment Equity in New Zealand: " & history & VbCrLf
Body = Body & "Definitions of Pay and Employment Equity Terms: " & definition & VbCrLf
Body = Body & "Pay and Employment Equity Contestable Fund: " & fund & VbCrLf
Body = Body & "Frequently Asked Questions: " & faqs & VbCrLf
Body = Body & "Pay Investigations: " & payinvestigations & VbCrLf
Body = Body & "Equitable Job Evaluation: " & jobevaluation & VbCrLf
Body = Body & "Steering Group Annual Report: " & annualreport & VbCrLf
Body = Body & "Case Study: MyCompany, Summary: " & sumdol & VbCrLf
Body = Body & "Case Study: MyCompany, Full: " & fulldol & VbCrLf
Body = Body & "Case Study: Education Review Office, Summary: " & sumero & VbCrLf
Body = Body & "Case Study: Education Review Office, Full: " & fullero & VbCrLf
Body = Body & "Case Study: Blue Station, Summary: " & sumscc & VbCrLf
Body = Body & "Case Study: Blue Station, Full: " & fullscc & VbCrLf
Body = Body & "Assessment Details: Equitable Job Evaluation Information: " & jetool & VbCrLf


	Set Email = Server.CreateObject("CDO.Message")
	Set EMailConfig = Server.CreateObject("CDO.Configuration") 'calls CDO configuration COM object
	'Set Flds = EmailConfig.Fields
	
	With EmailConfig.Fields
		.Item("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/sendusing")[/URL] = 1 'tells cdo we are using the local smtp service
		.Item("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory")[/URL] = "c:\inetpub\mailroot\pickup" 'verify that this path is correct
		.Update 'updates CDOs configuration
	End With
	
	With Email
		.Configuration = EMailConfig
		.From = "Stuff Website"
		.Subject = "Publications Order"
		.TextBody = body
		.To = "myemail@myemail.com"
		.Send
	End With

	Set EMailConfig = nothing
	Set Email = Nothing
	
	Response.Redirect "orderdone.asp"
%>
 
It can't just work once and then stop without you changing something or the SMTP server is blocking you.

The second is a possibility if your not using a local server and you have been spending a lot of time submitting emails. Try again and you may find the block is lifted, if that was the problem.

Failing that we are going to have to do a bit of debugging. We've been quite lucky so far in spotting the problems in your code however there is a lot of code there so lets try break it down and pin point the problem. The use of error handling (lots of examples if you look on Google) will help.

Nick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top