SitePoint Sponsor

User Tag List

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

    Question Hi, I use cdosys for an emaill form but the page does not pause before sending a repl

    Hi there

    I'm using cdosys to receive emails from people when they fill in a form. My problem is that if I use response.redirect the page goes to the linked page the moment the person opens up the form page. Response.write also doesn't work properly as the message immediately shows at the bottom of the form when the form page open up.
    I don't know what else to try.
    Can anyone please assist me with this?

    Here is my code:




    <html>
    <head>
    <title>Quote</title>
    <link rel="stylesheet" type="text/css" href="../css/submit.css">
    </head>
    <h1>QUOTE FORM</h1>
    <body>

    <form name="feedback" method="post" action="submit.asp">
    <label for="user">Your Name:</label>
    <input type="text" name="txtName" ><br>

    <label for="user">The Name of your Business:</label>
    <textarea name="txtBusiness" id="newsize" ></textarea><br>

    <label for="user">Your Email Address:</label>
    <input type="text" name="txtEmail" class="text"><br>

    <label for="user">Your Cellphone number:</label>
    <input type="text" name="txtCell" ><br>


    <label for="user">Registered with us: [y/n]</label>
    <input type="text" name="txtRegistered" ><br>

    <label for="user">Your Quote:</label>
    <textarea name="txtQuote" class="input"></textarea><br>


    <a href="#"><input type="submit" class="submit" value="Submit"></a>

    </form>

    </body>



    </html>


    <%


    Dim HTMLBody

    HTMLBody = HTMLBody & Replace(Request.Form("Contact_"), vbCrLf, "<br />") & "<br>" & "<br>"
    HTMLBody = HTMLBody & "<strong>" & "Your Name : " & "</strong>" & Request.Form("txtName") & "<br>"
    HTMLBody = HTMLBody & "<strong>" & " The Name of your Business : " & "</strong>" & Request.Form("txtBusiness") & "<br>"
    HTMLBody = HTMLBody & "<strong>" & "Your Email address : " & "</strong>" & Request.Form("txtEmail") & "<br>"
    HTMLBody = HTMLBody & "<strong>" & "Your Cellphone Number : " & "</strong>" & Request.Form("txtCell") & "<br>"
    HTMLBody = HTMLBody & "<strong>" & "Registered with us [y/n] : " & "</strong>" & Request.Form("txtRegistered") & "<br>"
    HTMLBody = HTMLBody & "<strong>" & "Your Quote : " & "</strong>" & Request.Form("txtQuote") & "<br>"



    'Create the e-mail server object
    Set objCDOSYSMail = Server.CreateObject("CDO.Message")
    Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")
    'Outgoing SMTP server
    objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
    objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
    objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
    objCDOSYSCon.Fields.Update 'Update the CDOSYS Configuration
    Set objCDOSYSMail.Configuration = objCDOSYSCon
    objCDOSYSMail.From = "hr@*****.co.za "
    objCDOSYSMail.To = "hr@*****.co.za"
    objCDOSYSMail.Subject = "Plants"
    objCDOSYSMail.HTMLBody = htmlBody
    objCDOSYSMail.Send
    'Close the server mail object
    Set objCDOSYSMail = Nothing
    Set objCDOSYSCon = Nothing

    <% Response.write "<p class='ok'>Sent OK</p>" %>

    %>

  2. #2
    SitePoint Member
    Join Date
    Feb 2012
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Correction

    Hi

    I removed the response.write line, I see my form shows an error message otherwise.

    Tx.

  3. #3
    SitePoint Member
    Join Date
    Feb 2012
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anyone???


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
  •