Sorting formfields in Email ASP

Results 1 to 2 of 2

Thread: Sorting formfields in Email ASP

  1. #1
    Join Date
    Dec 1969
    Posts
    632

    Default Sorting formfields in Email ASP

    I have put a form on my website which on submit will be mailed to a predifened mailadress.<BR>Everything works ok, but when I recieve the mail all the formfields are mixed up.<BR>What code do I have to insert (in the HTML page and the ASP file) to recieve the mail in a properly sorted way?<BR>For example: Name, Adress, ZIPcode, Place etc...<BR>As you will notice, I&#039m pretty new to ASP :-)<BR><BR>Thanks for your reply.<BR><BR>Ben<BR>bkah@ifc.nl

  2. #2
    Join Date
    Dec 1969
    Posts
    1,315

    Default RE: Sorting formfields in Email ASP

    You can grab the field input from your html form and arrange it in the body of the note in any order you like.<BR><BR>Dim strTo<BR>Dim strFrom<BR>Dim strSubject <BR>Dim strBody<BR>Dim objCDOMail<BR><BR>strFrom = Request.Form("fromfield") <BR>strBody = "Name: " & Request.Form("namefield") & vbCrLf<BR>strBody = strBody & "Address: " & Request.Form("addressfield") & vbCrLf<BR>strBody = strBody & "Zip: " & Request.Form("zipfield")<BR><BR>Set objCDOMail = Server.CreateObject("CDONTS.NewMail")<BR> <BR>objCDOMail.From = StrFrom<BR>objCDOMail.To = "predefinedaddress@xx.com"<BR>objCDOMail.Subje ct = "Form Info"<BR>objCDOMail.Body = strBody

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •