Help with asp web form

A

Andy

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 = "(e-mail address removed)"
MailObject.To = "(e-mail address removed)"
MailObject.Subject = "Form"

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

%>
 
R

Ray at

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 = "(e-mail address removed)"
MailObject.To = "(e-mail address removed)"
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
 
R

Ray at

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
 
A

Andy

Ray at said:
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 = "(e-mail address removed)"
MailObject.To = "(e-mail address removed)"
MailObject.Subject = "Form"
MailObject.Body = sBody & vbCrLf

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

%>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,078
Messages
2,570,572
Members
47,204
Latest member
MalorieSte

Latest Threads

Top