%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 %>
![]() |
|
![]() |
![]() |
![]() |
![]() |
|
![]() |
||||||
![]() |
![]() |
|||||
![]() |
||||||
|
|
||||||