Web Design and Development Forums

ASP Form - email won't process

This is a discussion on "ASP Form - email won't process" within the ASP Forum section. This forum, and the thread "ASP Form - email won't process are both part of the Program Your Website category.


Go Back   Webforumz.com > Program Your Website > ASP Forum

Welcome to Webforumz.com.
Register Now Register now!

Reply
 
LinkBack Thread Tools Rate Thread
Old Nov 28th, 2007, 07:21   #1 (permalink)
New Member
 
Join Date: Nov 2007
Location: dublin
Age: 22
Posts: 1
ASP Form - email won't process

Hi

This is my first asp form so please be gentle with me

I've setup this form and when I test it and 'send' the email isn't coming through. Can anyone spot a problem in the code?

Thanks for your help

FORM Code

Code: Select all
 
<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 </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: Select all
 <%

' 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("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1 'tells cdo we are using the local smtp service
		.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "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"
%>
tinggg is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Nov 28th, 2007, 07:57   #2 (permalink)
Most Reputable Member
 
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,567
Blog Entries: 2
Send a message via Yahoo to Monie
Re: ASP Form - email won't process

Someone help me, I don't have any experience with this
Just hang on there Tingg, I know someone that can help you...!
__________________

Monie is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Nov 28th, 2007, 08:55   #3 (permalink)
Up'n'Coming Member
 
Join Date: Sep 2007
Location: Wales, UK
Age: 35
Posts: 75
Send a message via MSN to robbied72 Send a message via Skype™ to robbied72
Re: ASP Form - email won't process

Who are you hosted with as some hosts block port 25 and you have to use a relay, also have you checked to see what mail components are installed on the server?

Use the attached file to determine what components are installed before you do anything else, you will have to change the file from .txt to .asp...

test_mailer_components.txt

Additionally when dim'ing variables you don't have to dim on separate lines, you can comma separate them like so:-

Code: Select all
<%
Dim vVar1,vVar2,vVar3
vVar1 = some_value
vVar2 = some_value
vVar3 = some_value
%>
Hope this helps you mate.
__________________
Languages: ASP, RUBY(a little), XML, XHTML, CSS, JavaScript, JQuery - www.bizmo.co.uk
robbied72 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Nov 28th, 2007, 09:00   #4 (permalink)
 
JustinStudios's Avatar
 
Join Date: Mar 2007
Location: USA
Posts: 457
Blog Entries: 3
Send a message via MSN to JustinStudios
Re: ASP Form - email won't process

Yeah, make sure you have the capabilities first then go from there. If not I believe (could be wrong) that there is a work-a-round with posting directly to an email adress, but I've been told this is very unsecure.
__________________
My Website www.justudios.com is here!
Availability: YES | NO
ASP | PHP |Flash | Design | Contract Work
JustinStudios is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Nov 28th, 2007, 10:09   #5 (permalink)
Section Manager -
Website Critique
 
welshstew's Avatar
 
Join Date: May 2007
Location: inside the outside
Posts: 1,094
Blog Entries: 10
Re: ASP Form - email won't process

Is it getting to the redirect or just not doing anything?
__________________
WelshStew
Section Manager

tierney rides tboard - uk site : xtreme wales - extreme clothing
welshstew is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Nov 28th, 2007, 10:19   #6 (permalink)
Section Manager -
Website Critique
 
welshstew's Avatar
 
Join Date: May 2007
Location: inside the outside
Posts: 1,094
Blog Entries: 10
Re: ASP Form - email won't process

I'm also new to ASP but I'm also a little bit confused as to what the following is doing:
Code: Select all
	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("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1 'tells cdo we are using the local smtp service
		.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "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
could you try the following instead of the above and see what happens (ensure you have a backup of the original - I am still learning...)
Code: Select all
' send email 
Dim mail
Set mail = Server.CreateObject("CDONTS.NewMail") 
mail.To = EmailTo
mail.From = EmailFrom
mail.Subject = Subject
mail.Body = Body
mail.Send
__________________
WelshStew
Section Manager

tierney rides tboard - uk site : xtreme wales - extreme clothing
welshstew is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Nov 28th, 2007, 10:28   #7 (permalink)
Up'n'Coming Member
 
Join Date: Sep 2007
Location: Wales, UK
Age: 35
Posts: 75
Send a message via MSN to robbied72 Send a message via Skype™ to robbied72
Re: ASP Form - email won't process

Quote:
Originally Posted by welshstew View Post
I'm also new to ASP but I'm also a little bit confused as to what the following is doing:
Code: Select all
    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("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1 'tells cdo we are using the local smtp service
        .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "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
could you try the following instead of the above and see what happens (ensure you have a backup of the original - I am still learning...)
Code: Select all
' send email 
Dim mail
Set mail = Server.CreateObject("CDONTS.NewMail") 
mail.To = EmailTo
mail.From = EmailFrom
mail.Subject = Subject
mail.Body = Body
mail.Send
Hi Stew,

The object has to be created in order for it to work.
__________________
Languages: ASP, RUBY(a little), XML, XHTML, CSS, JavaScript, JQuery - www.bizmo.co.uk
robbied72 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Nov 28th, 2007, 10:37   #8 (permalink)
Up'n'Coming Member
 
Join Date: Sep 2007
Location: Wales, UK
Age: 35
Posts: 75
Send a message via MSN to robbied72 Send a message via Skype™ to robbied72
Re: ASP Form - email won't process

Try this: -

Code: Select all
<%
Dim vUserEmail, vSubject , vMessage 
vUserEmail = Request.Form("UserEMail")
vSubject = Request.Form("Subject")
vMessage  = Request.Form("UserMessage")
%>
<%
Dim myMail
Set myMail=CreateObject("CDO.Message")
myMail.Subject= vSubject
myMail.From= vUserEmail 'pick up users email from variable
myMail.To= "you@you.com" 'Destination email
myMail.Bcc="blind@blind.com" 'use this if you want a bcc
myMail.HTMLBody = vMessage 'message/body
myMail.Send
set myMail=nothing
%>
<%Response.Redirect("thankyou.asp")%>
__________________
Languages: ASP, RUBY(a little), XML, XHTML, CSS, JavaScript, JQuery - www.bizmo.co.uk
robbied72 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP email form not sending email Kurt PHP Forum 1 Oct 12th, 2007 04:26
Form submits to email via php, but email is blank!!?? DH1234 PHP Forum 2 Jun 18th, 2007 10:42
can get php to process my form, why? enrique PHP Forum 15 Dec 6th, 2006 19:52
Email form using asp QuizToon ASP Forum 2 Mar 28th, 2006 00:25
Form handling Process in ASP? sazhagianambi ASP Forum 4 May 27th, 2004 12:59



Latest Updates

All Points SEO Security Advisory - CHECK YOUR SITE NOW!

Creative Coding :: February 2008

Webforumz is sponsored by: WESH UK Web Hosting
All times are GMT. The time now is 13:24.

Sleep Study Scoring :: Free Bet :: Website Templates :: Online Betting :: Bookmakers :: Funny Quotes :: Internet Recruitment Software :: Microsoft CRM Experts :: Online Casino :: Decorated Christmas Trees :: Midwife Forums :: Football Betting :: Ecommerce Software :: Web Hosting :: Football Stats :: Dry Cleaning Collection :: xtreme wales - extreme clothing :: Apuestas :: Sharepoint Consultants :: Website Optimisation :: Office Clearance London :: Sharepoint Experts :: Sports Betting :: Casino :: Website Templates :: Web Design Development India :: Online Gambling

Powered by: vBulletin Version 3.7, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
© 2003-2008 Webforumz.com : All Rights Reserved
Search Engine Friendly URLs by vBSEO 3.2.0 RC6


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59