Order of data from Form Fields

P

Peter

Dear All, I have an odd problem. I am using the asp code below to loop
through a form and get the data sent out in an email... however the
data from the form arrives out of order. Can any one suggest how to put
the data in the same order as the form?

<%
Dim objMail
Set objMail = CreateObject("CDONTS.Newmail")
objMail.TO = "(e-mail address removed)"
objMail.From = Request.Form("Email")
objmail.Subject = "Booking Request from XYZ Web Site"
objMail.MailFormat = cdoMailFormatMime
objMail.BodyFormat = cdoBodyFormatHTML

sMailBody = sMailBody &"<html><body>"
For each item in Request.Form
if item <> "submit" then
if item <> "clear" then
sMailBody=sMailBody & item & ": " & Request.Form(item) & "<br>"
end if
end if
next
sMailBody = sMailBody &"</body></html>"

objMail.Body = sMailBody
objMail.send
set objMail = Nothing
%>
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top