<%if request("name") <> "" then dim conn, sql, ckrs, name, company, phone, email, category, comments, mailbody name = killChars(request("name")) company = killChars(request("company")) phone = killChars(request("p1")) & killChars(request("p2")) & killChars(request("p3")) email = killChars(request("email")) category = killChars(request("category")) comments = killChars(request("comments")) mailbody = "Name: " & replace(name,"''","'") & vbcrlf mailbody = mailbody & "Company: " & replace(company,"''","'") & vbcrlf mailbody = mailbody & "Phone: " & replace(phone,"''","'") & vbcrlf mailbody = mailbody & "Email: " & replace(email,"''","'") & vbcrlf mailbody = mailbody & "Category: " & replace(category,"''","'") & vbcrlf mailbody = mailbody & "Comments: " & replace(comments,"''","'") set conn = server.createobject("adodb.connection") 'conn.open "Provider=SQLOLEDB;Data Source=DRISCOLL-9CE296;User Id=h@ns3n; Password=c@mer0n;Database=hansencs" conn.open "Provider=SQLOLEDB;Data Source=sql2k511.discountasp.net;User Id=SQL2005_685200_hansencs_user;Password=hans3n;Database=SQL2005_685200_hansencs" 'do we already have this email address? sql = "select id from mailinglist where email = '" & email & "'" set ckrs = conn.execute(sql) call errorHandler if ckrs.eof then sql = "insert into mailinglist (name, company, phone, email, category, comments) values ('" & name & "', '" & company & "', '" & phone & "', '" & email & "', '" & category & "', '" & comments & "')" conn.execute(sql) call errorHandler end if conn.close set conn = nothing call errorHandler 'send an email set objMessage = createobject("cdo.message") set objConfig = createobject("cdo.configuration") ' Setting the SMTP Server Set Flds = objConfig.Fields Flds.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 Flds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost" Flds.update Set objMessage.Configuration = objConfig objMessage.To = email objMessage.From = "info@hansencs.com" objMessage.Subject = "A new addition to the Hansen Creative Services mailing list!" objMessage.HTMLBody = mailbody objMessage.fields.update objMessage.Send set objMessage = nothing set objConfig = nothing call errorHandler response.redirect("index.html") end if %> Join our mailing list!
Join our mailing list and get free stuff!

Much like the soulless face of Corporate America, we want to collect all of your information and use it to bend you to our will. Unlike Corporate America, we will give you something useful in return. Once you’ve entered your info, click the “Submit to Download” button and you’ll receive a copy of our priceless
(‘cause it’s free) white paper
on marketing your business. It’s a quick read and might even give you some information you didn’t already know.
Name
Company
Phone - -
email address
Owner
Employee
Spiritless Drone on a fact-finding mission
What can we do for you?
Submit to download
 
<% function killChars(strWords) dim badChars, newChars, i badChars = array("select", ";", "--", "insert", "delete", "xp_", "=") newChars = strWords for i = 0 to uBound(badChars) newChars = replace(newChars, badChars(i), "") next newChars = trim(replace(newChars,"'","''")) killChars = newChars end function sub errorHandler if err.number <> 0 then Dim errMail Set errMail = Server.CreateObject("CDONTS.NewMail") errMail.From = "nhampton@columbus.rr.com" errMail.To = "nhampton@columbus.rr.com" errMail.Subject = "An error has occurred in the hansen cs mailing list page" errMail.Body = "The error is: " & err.description & vbcrlf & vbcrlf errMail.Send set errMail = nothing Response.Redirect "error.asp" end if end sub %>