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:

<link rel=“stylesheet” type=“text/css” href=“…/css/submit.css”>
<h1>QUOTE FORM</h1>

&lt;form name="feedback" method="post" action="submit.asp"&gt;
	&lt;label for="user"&gt;Your Name:&lt;/label&gt;
	&lt;input type="text" name="txtName" &gt;&lt;br&gt;

	&lt;label for="user"&gt;The Name of your Business:&lt;/label&gt;
	&lt;textarea name="txtBusiness" id="newsize" &gt;&lt;/textarea&gt;&lt;br&gt;

	&lt;label for="user"&gt;Your Email Address:&lt;/label&gt;
	&lt;input type="text" name="txtEmail" class="text"&gt;&lt;br&gt;

	&lt;label for="user"&gt;Your Cellphone number:&lt;/label&gt;
	&lt;input type="text" name="txtCell" &gt;&lt;br&gt;

	&lt;label for="user"&gt;Registered with us: [y/n]&lt;/label&gt;
	&lt;input type="text" name="txtRegistered" &gt;&lt;br&gt;

	&lt;label for="user"&gt;Your Quote:&lt;/label&gt;
	&lt;textarea name="txtQuote" class="input"&gt;&lt;/textarea&gt;&lt;br&gt;

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





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@
objCDOSYSMail.Subject = “Plants”
objCDOSYSMail.HTMLBody = htmlBody
'Close the server mail object
Set objCDOSYSMail = Nothing
Set objCDOSYSCon = Nothing

<% Response.write “<p class=‘ok’>Sent OK</p>” %>



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