SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Feb 2011
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Some rcvd forms are blank in Outlook

    First, I am not an ASP programmer, and am struggling to find an answer to a problem we are having.

    We use ASP forms on our website (http://www.proturf.com/partsorder.shtml) for customers to order parts. These forms send an e-mail to a group address setup in Exchange/Outlook. Some recipients get an empty screen and no data, while others get the data. And, to complicate things, this problem is random... one rep may get data this time, but not next time... or, all may get the data.

    Does anyone have any idea's what may be the problem? I do not know how long this has been an issue. We moved our hosing to Register.com about a year ago.

    I really appreciate any help you may provide.

    Thanks!
    Dan

  2. #2
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,631
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Purely as a guess ... does the ASP code do proper validation of the form data before trying to send the email? I am thinking that it may be that the user is sometimes entering data with quotes ( " ) or apostrophes ( ' ) and the ASP code is not handling these correctly, thus setting a blank field for the email body.
    Ian Anderson
    www.siteguru.co.uk

  3. #3
    SitePoint Member
    Join Date
    Feb 2011
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the reply! I know just about zip when it comes to ASP... so, I'm not even sure how to answer your question. Does any of this help? It's from the Product2.asp file the form appears to use.
    Sorry I am so ignorant about ASP. I really appreciate your help!
    Dan

    Code:
    <%response.buffer=false%>
    <!--#include file="includes/adovbs.inc"-->
    
    
    <%
    
    Dim sBody
    Dim sResponse
    Dim objSendMail
    Dim Mail
    
    Set Mail = Server.CreateObject("Persits.MailSender")
    'Set  Mail = Server.CreateObject("CDONTS.NewMail")
    
                
                Mail.Host = "web1.xxx.com"
                Mail.From = "webmail@xxx.com"
                Mail.AddAddress "weborders@xxx.com"
                'Mail.AddBcc "dwigert@xxx.com"
                'Mail.AddCC "acostaa@xxx.com"
                Mail.Subject = "Parts Order Form!"
                
                sBody = "Email Form Results:" & chr(13)            
                
                sBody = sBody & "Last Name: " & Request.Form("txtLast") & chr(13)
                sBody = sBody & "First Name: " & Request.Form("txtFirst") & chr(13)
                sBody = sBody & "Company: " & Request.Form("txtCompany") & chr(13)
                sBody = sBody & "Billing Address: " & Request.Form("txtBaddress") & chr(13)
                sBody = sBody & "Bill State: " & Request.Form("txtBstate") & chr(13)
                sBody = sBody & "Bill Zip: " & Request.Form("txtBzip") & chr(13)
                sBody = sBody & "Bill City: " & Request.Form("txtBcity") & chr(13)
                sBody = sBody & "PO: " & Request.Form("txtPO") & chr(13)
                sBody = sBody & "Shipping Address: " & Request.Form("txtSaddress") & chr(13)
                sBody = sBody & "Ship State: " & Request.Form("txtSstate") & chr(13)
                sBody = sBody & "Ship Zip: " & Request.Form("txtSzip") & chr(13)
                sBody = sBody & "Ship City: " & Request.Form("txtScity") & chr(13)
                sBody = sBody & "Email: " & Request.Form("txtEmail") & chr(13)
                sBody = sBody & "Phone: " & Request.Form("txtPhone") & chr(13)
                sBody = sBody & "Product Number 1: " & Request.Form("txtPN1") & chr(13)
                sBody = sBody & "Quantity for Product 1: " & Request.Form("txtQ1") & chr(13)
                sBody = sBody & "Product Number 2: " & Request.Form("txtPN2") & chr(13)
                sBody = sBody & "Qunatity for Product 2: " & Request.Form("txtQ2") & chr(13)
                sBody = sBody & "Product Number 3: " & Request.Form("txtPN3") & chr(13)
                sBody = sBody & "Quantity for Product 3: " & Request.Form("txtQ3") & chr(13)
                sBody = sBody & "Product for Number 4: " & Request.Form("txtPN4") & chr(13)
                sBody = sBody & "Quantity for Product 4: " & Request.Form("txtQ4") & chr(13)
                sBody = sBody & "Product Number 5: " & Request.Form("txtPN5") & chr(13)
                sBody = sBody & "Quantity for Product 5: " & Request.Form("txtQ5") & chr(13)
                sBody = sBody & "Product Number 6: " & Request.Form("txtPN6") & chr(13)
                sBody = sBody & "Quantity for Product 6: " & Request.Form("txtQ6") & chr(13)
                sBody = sBody & "Product Number 7: " & Request.Form("txtPN7") & chr(13)
                sBody = sBody & "Quantity for Product 7: " & Request.Form("txtQ7") & chr(13)
                sBody = sBody & "Product Number 8: " & Request.Form("txtPN8") & chr(13)
                sBody = sBody & "Quantity for Product 8: " & Request.Form("txtQ8") & chr(13)
                sBody = sBody & "Product Number 9: " & Request.Form("txtPN9") & chr(13)
                sBody = sBody & "Quantity for Product 9: " & Request.Form("txtQ9") & chr(13)
                sBody = sBody & "Product Number 10: " & Request.Form("txtPN10") & chr(13)
                sBody = sBody & "Quantity for Product 10: " & Request.Form("txtQ10") & chr(13)
                sBody = sBody & "Comments:" & Request.Form("txtComments") & chr(13)
                
                Mail.Body = sBody
                
                Mail.Send 
                    
    'If sResponse > 0 then
        Response.Redirect "http://www.xxx.com/partsorder-thanks.shtml"
        'Else
            'Response.Write sResponse
        'End If
    %>
    Last edited by spikeZ; Feb 11, 2011 at 10:23.

  4. #4
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    Edited your post dwigert, you dont really want those email addresses all over the net!
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  5. #5
    SitePoint Member
    Join Date
    Feb 2011
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you! I thought about that after I selected the post button.

    Appreciate you help!

  6. #6
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,631
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    My thought may be correct ... all of the Request.Form("XXXX") elements are being used directly to build the email body, rather than being placed in variables and then having the data validated before being used.

    I'm not familiar with the workings of Persits.MailSender so I don't know how robust it is to issues with malformed strings (sBody is a string variable). But what you could do is temporarily modify the page (like below) and do some tests ... probably using the Last Name field, though you could test with several other fields too. The tests would involve using a variety of different string data to include different characters each time (e.g. " or ' or ! etc.) and see if the sBody string becomes corrupt.
    Code:
    <snip>
    
                Response.Write sBody 'Debug line
                Response.End 'Debug line
                Mail.Body = sBody
                
                Mail.Send
    Once you've done your testing then you can delete those debug lines. Hopefully the testing will highlight what is causing the problem.
    Ian Anderson
    www.siteguru.co.uk


Bookmarks

Posting Permissions

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