jeremy-h of Web Development
10/24/2017 - 4:19 PM

Contact Form

Basic Contact Form we use on our IIS that I think is using ASP and VB Script.

<%
	If ((request("name") <> "") and (request("phone") <> "") and (request("email") <> "") and (request("message") <> "") and (request("seeker") = "")) then
	
	'Dimension variables
	Dim myCon, myMail, Body
	
	'Create the e-mail server object
	Set myMail = Server.CreateObject("CDO.Message")
	Set myCon = Server.CreateObject ("CDO.Configuration")
	
	'Out going SMTP server
	myCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "dedrelay.secureserver.net"
	myCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
	myCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
	myCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
	myCon.Fields.Update
	
	'Update the cdosys Configuration
	Set myMail.Configuration = myCon
	
	myMail.From = "info@capitoltechsolutions.com"
	myMail.To = "test@test.com"
	myMail.Cc = "test2@test.com"
	myMail.Subject = "A new Contact from the Website"

	Body = "<html>"
	Body = Body + " <body>"
	Body = Body + "You have a new website message"
	Body = Body + "<br><br>"
	
	Body = Body + "<br>Name: " & request("name")
	Body = Body + "<br>Phone: " & request("phone")
	Body = Body + "<br>Email: " & request("email")
	Body = Body + "<br>Message: " & request("message") & "<br>"

	if request("checkbox1") <> "" then Body = Body & request("checkbox1") & ", "

	Body = Body + "</body></html>"	

	myMail.HTMLBody = Body
	myMail.Send
	
	End If
%>