kessa
08-16-2006, 11:27 AM
Hi Guys,
I've got a simple contact form on my website which sends the result using .asp to me via email.
The weird thing is that the order of the information received in the email seems to be random (or at least, doesn't have any correlation to the order of the items in the form itself)
So for example, in my form I have the following items in the following order:
Title
First name
Surname
Address
Town / City
Country
Postcode
Tel
Comments
However, the order in which the result arrive is random (here's an example)
title = Mr
address = address
comments = comments
firstname = name
surname = surname
postcode = postcode
country = country
town = town
tel = daytel
In the words (almost) of Morcambe and Wise... "I've got all the right results, just not necesarily in the right order"
Does anyone have any ideas why this may be happening? I don't think that there is anything too odd about my code but here it is just in case.
html = "<!DOCTYPE html PUBLIC'-//IETF//DTD html//EN'><html><head><meta http-equiv='Content-Type'><content='text/html; charset=iso-8859-1'><title>email</title>"
html = html & "<style type='text/css'><!--"
html = html & ".maintext {font-family: Verdana; font-size: 9pt;color: #333333;font-weight: 400;}"
html = html & ".white-medium {font-family: Verdana; font-size: 11pt;color: #ffffff;font-weight: 400;}"
html = html & "--></style></head><body><span class='maintext'>"
html = html & "<br /><b>Message sent: " & Date & " " & time & "</b><br />"
for each thingy in request.form
if not thingy="Action" then
html = html & "<br />" & thingy & " = " & request(thingy)
end if
next
html = html & "<br /><br />"
html = html & "</span></body></html>"
Set MailObj = Server.CreateObject("CDONTS.NewMail")
MailObj.From = "contactform@mywebsiteaddress.co.uk"
MailObj.To = "email@mywebsiteaddress.co.uk"
MailObj.Subject = "Contact Form"
MailObj.Importance = 1
MailObj.BodyFormat=0
MailObj.MailFormat=0
MailObj.Body = html
MailObj.Send
Set MailObj = Nothing
Thanks
Kessa
I've got a simple contact form on my website which sends the result using .asp to me via email.
The weird thing is that the order of the information received in the email seems to be random (or at least, doesn't have any correlation to the order of the items in the form itself)
So for example, in my form I have the following items in the following order:
Title
First name
Surname
Address
Town / City
Country
Postcode
Tel
Comments
However, the order in which the result arrive is random (here's an example)
title = Mr
address = address
comments = comments
firstname = name
surname = surname
postcode = postcode
country = country
town = town
tel = daytel
In the words (almost) of Morcambe and Wise... "I've got all the right results, just not necesarily in the right order"
Does anyone have any ideas why this may be happening? I don't think that there is anything too odd about my code but here it is just in case.
html = "<!DOCTYPE html PUBLIC'-//IETF//DTD html//EN'><html><head><meta http-equiv='Content-Type'><content='text/html; charset=iso-8859-1'><title>email</title>"
html = html & "<style type='text/css'><!--"
html = html & ".maintext {font-family: Verdana; font-size: 9pt;color: #333333;font-weight: 400;}"
html = html & ".white-medium {font-family: Verdana; font-size: 11pt;color: #ffffff;font-weight: 400;}"
html = html & "--></style></head><body><span class='maintext'>"
html = html & "<br /><b>Message sent: " & Date & " " & time & "</b><br />"
for each thingy in request.form
if not thingy="Action" then
html = html & "<br />" & thingy & " = " & request(thingy)
end if
next
html = html & "<br /><br />"
html = html & "</span></body></html>"
Set MailObj = Server.CreateObject("CDONTS.NewMail")
MailObj.From = "contactform@mywebsiteaddress.co.uk"
MailObj.To = "email@mywebsiteaddress.co.uk"
MailObj.Subject = "Contact Form"
MailObj.Importance = 1
MailObj.BodyFormat=0
MailObj.MailFormat=0
MailObj.Body = html
MailObj.Send
Set MailObj = Nothing
Thanks
Kessa