473,388 Members | 1,234 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Help with asp web form

I have the following script to send my website form.

The problem is when the form is submitted it sends a blank form

Can anyone advise how i get the below to include the contents of all the
form fields.

The only way i found was to add each form field name in seperately however
there are
25 different fields. Is there way to get the below script to send
everything entered into the form

Many thanks


<%
Set MailObject = Server.CreateObject("CDONTS.NewMail")
MailObject.From = "we*****@xxx.com"
MailObject.To = "we*****@xxx.com"
MailObject.Subject = "Form"

MailObject.Send
Set MailObject = Nothing
' Now redirect
Response.Redirect "http://www.xxx.com/thank_you.htm"

%>
Jul 19 '05 #1
4 3393
This won't produce the prettiest result, but you can do:

<%
For Each x in request.form
sBody = sBody & x & " = " & request.form(x) & vbCrLf
Next
Set MailObject = Server.CreateObject("CDONTS.NewMail")
MailObject.From = "we*****@xxx.com"
MailObject.To = "we*****@xxx.com"
MailObject.Subject = "Form"
MailObject.Body = sBody & "Love," & vbCrLf & "Andy"

MailObject.Send
Set MailObject = Nothing
' Now redirect
Response.Redirect "http://www.xxx.com/thank_you.htm"

%>

Also, unless you're on an NT4 server, you should start using CDO instead of
CDONTS.

Ray at work

"Andy" <no****@nospam.com> wrote in message
news:10****************@doris.uk.clara.net...
I have the following script to send my website form.

The problem is when the form is submitted it sends a blank form

Can anyone advise how i get the below to include the contents of all the
form fields.

The only way i found was to add each form field name in seperately however
there are
25 different fields. Is there way to get the below script to send
everything entered into the form

Many thanks


<%
Set MailObject = Server.CreateObject("CDONTS.NewMail")
MailObject.From = "we*****@xxx.com"
MailObject.To = "we*****@xxx.com"
MailObject.Subject = "Form"

MailObject.Send
Set MailObject = Nothing
' Now redirect
Response.Redirect "http://www.xxx.com/thank_you.htm"

%>

Jul 19 '05 #2

Also, unless you're on an NT4 server, you should start using CDO instead of CDONTS.

Ray at work


what makes u say this. I'm running on win2k
TIA
Jul 19 '05 #3
CDONTS exists in W2K still just for legacy support. It does not exist in
IIS 5.1 or 6.0. CDO is the new way. "New way? What's this about a new
way?"

Ray at work

"Andy" <no****@nospam.com> wrote in message
news:10****************@damia.uk.clara.net...

Also, unless you're on an NT4 server, you should start using CDO instead

of
CDONTS.

Ray at work


what makes u say this. I'm running on win2k
TIA

Jul 19 '05 #4

"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:ux*************@TK2MSFTNGP09.phx.gbl...
CDONTS exists in W2K still just for legacy support. It does not exist in
IIS 5.1 or 6.0. CDO is the new way. "New way? What's this about a new
way?"

Ray at work

Ah ok.
Unfortunately the cdonts script is the only script i have so ill have to
stick with that.

Re the script below. Any idea why i get a Submit y=5 and Submit x=26
results
included after my form field results?

Email results:

Name = xxxx
Tel = xxxx
Email = xxxx
State = xxxx
Details = xxxx
Submit.y = 5
Submit.x = 26
Script:
<%

For Each x in request.form
sBody = sBody & x & " = " & request.form(x) & vbCrLf
Next
Set MailObject = Server.CreateObject("CDONTS.NewMail")
MailObject.From = "we*****@xxx.com"
MailObject.To = "we*****@xxx.com"
MailObject.Subject = "Form"
MailObject.Body = sBody & vbCrLf

MailObject.Send
Set MailObject = Nothing
' Now redirect
Response.Redirect "http://www.xxx.com/thank_you.htm"

%>


Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: GrelEns | last post by:
hello, i had a trouble with re that i didn't understand (this is a silly example to show, to parse html i use sgmllib) : having this string : >>> s = """<form name="test" method="post"...
6
by: James Walker | last post by:
Can some one help I get an error of 'checkIndate' is null or not an object can someone please help. I can't work out why Thanks in advance James <form> <td height="24" colspan="7"...
5
by: Craig Keightley | last post by:
Please help, i have attached my page which worksin IE but i cannnot get the drop down menu to fucntion in firefox. Any one have any ideas why? Many Thanks Craig ...
0
by: Pat Patterson | last post by:
I'm having serious issues with a page I'm developing. I just need some simple help, and was hoping someone might be able to help me out in here. I have a form, that consists of 3 pages of...
2
by: chanchito_cojones | last post by:
hi there, I am needing some help with a database I am putting together. The database works off of a main Form, which then has buttons on it that will open up other forms. The problem I am having...
5
by: Steve Patrick | last post by:
Hi All You guys are my last hope, despite spending money on books and hours reading them I still can not achieve the results I need. I have designed a database in Access 2000 based on 1 table,...
5
by: TD | last post by:
Hey All, I am hooking up our custom html (.chm) help file to our Access xp application, and, despite reading several posts and manuals on this, I still have a gap in my understanding... OK, so...
1
by: Michael D. Reed | last post by:
I am using the help class to display a simple help file. I generated the help file using Word and saving it as a single page Web page (.mht extension). I show the help file with the following...
4
by: jerry.ranch | last post by:
Say, on a data entry form a "HELP" cmbBUTTON that bounces the user off to word file that has help, or is there some other way to do it (like a label object with help on another form) Thanks...
10
by: 60325 | last post by:
This is the page where I collect the data in drop-down boxes with values of 1-10 and send it to a submitted page to do calculations. Example: Employee1 TeamScore(1-10) Employee2 ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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,...
0
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...

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.