Submitting huge ASPMail order forms

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • itsjules
    New Member
    • Jul 2006
    • 2

    Submitting huge ASPMail order forms

    I have created HUGE order forms for a client using HTML (Dreamweaver Studio MX 2004) for the forms and ASPMail for the submission of the forms. Everything works fine, except ALL the fields are submitted with every order, and I want ONLY the fields that have something in them to be submitted.

    Right now my client gets a huge list of all the fields in the forms with most of them blank and a few with numbers denoting how many items a customer wants to order.

    The main problem is that I'm not technically a programmer--I'm trying really hard to learn on my own, and it's difficult.

    Here's the code from my "form action" page--Please be aware that to protect my client's privacy, I've replace all instances of his name and email address/domain name with "client@domain. com", etc.



    <%
    Set Mailer = Server.CreateOb ject("SMTPsvg.M ailer")
    Mailer.FromName = "Order"
    Mailer.FromAddr ess= "root@domain.co m"
    Mailer.RemoteHo st = "mail.domain.co m"
    Mailer.AddRecip ient "ClientName ", "client@domain. com"
    Mailer.Subject = "Order"
    strMsgHeader = "Form Information Follows: " & vbCrLf
    for i = 1 to Request.Form.Co unt
    strMsgInfo = strMsgInfo & Request.Form.Ke y(i) & " - " & Request.Form.It em(i) & vbCrLf
    next
    strMsgFooter = vbCrLf & "End of form information"
    Mailer.BodyText = strMsgHeader & strMsgInfo & strMsgFooter

    if Mailer.SendMail then
    Response.Write "Thank you for using our online ordering system. You will be sent an invoice via email which you may pay online."
    else
    Response.Write "Mail send failure. Error was " & Mailer.Response
    end if
    set Mailer = Nothing
    %>


    Any help anyone could provide would be greatly appreciated.
  • cbrao
    New Member
    • Jul 2006
    • 3

    #2
    Simple..Put a IF condition in for loop like ..
    if Request.Form.It em(i)<>"" then
    strMsgInfo = strMsgInfo & Request.Form.Ke y(i) & " - " & Request.Form.It em(i) & vbCrLf
    End if

    Comment

    • itsjules
      New Member
      • Jul 2006
      • 2

      #3
      Thanks so much; I'll give it a try.

      I really appreciate your taking the time to reply :)

      Comment

      • wsrinivas
        New Member
        • Jul 2006
        • 10

        #4
        if you have loads of such forms to be processed everyday then may be you save them every forms details as a text file on the server with sessionID as the filename and attached it to the mail or as your client to download using FTP

        This will reduce your mailserver overload

        Comment

        Working...