Forums
This topic is locked
ordering form elements in CDONTS emails
23 Dec 2002 11:13:33 Stefan P posted:
<font color=blue><font face='Verdana'>how can i control the order that form elements appear in the body of a cdonts created email.
i.e. The form elements on the html page are ordered but when they are passed into the email body, using the following script, the order seems random!
<%
strBody = ""
FOR EACH THING in request.form
strBody = strBody & THING & vbcrlf & request(THING) & vbcrlf
NEXT
Set objMail = Server.CreateObject("CDONTS.NewMail"
objMail.From=" "
objMail.To=" "
objMail.Subject="Website Enquiry"
objMail.Body=strBody
objMail.Send
Set objMail = nothing
%>
</font id='Verdana'></font id=blue>
UD4 | ASP | VBScript | ACCESS | IIS5
Replies
Replied 23 Dec 2002 12:33:03
23 Dec 2002 12:33:03 Owen Eastwick replied:
You have to request each form element individually if you want them in a specific order:
<%
strBody = ""
strBody = strBody & "Field1: " & request("Field1" & vbcrlf
strBody = strBody & "Field2: " & request("Field2" & vbcrlf
strBody = strBody & "Field3: " & request("Field3"
NEXT
Set objMail = Server.CreateObject("CDONTS.NewMail"
objMail.From=" "
objMail.To=" "
objMail.Subject="Website Enquiry"
objMail.Body=strBody
objMail.Send
Set objMail = nothing
%>
Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
<%
strBody = ""
strBody = strBody & "Field1: " & request("Field1" & vbcrlf
strBody = strBody & "Field2: " & request("Field2" & vbcrlf
strBody = strBody & "Field3: " & request("Field3"
NEXT
Set objMail = Server.CreateObject("CDONTS.NewMail"
objMail.From=" "
objMail.To=" "
objMail.Subject="Website Enquiry"
objMail.Body=strBody
objMail.Send
Set objMail = nothing
%>
Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo