%@Language=VBScript %> <% Option explicit if Request.ServerVariables("REQUEST_METHOD") = "POST" then dim bodyText dim newline dim key newline = vbNewLine ' format the email body bodyText = "Area(s) of interest:" & newline & newline for each key in Request.Form if UCase(Left(key, 8)) = "CHECKBOX" then bodyText = bodyText & Request.Form(key) & newline 'Response.Write("
Request.Form(" & key & ") = " & Request.Form(key) & "
") end if next bodyText = bodyText & newline if Request.Form("meeting") = "Y" then bodyText = bodyText & "I would like to schedule a meeting to further discuss the items I have checked above" & newline & newline end if if Request.Form("callme") = "Y" then bodyText = bodyText & "Please call me to schedule a general capabilities presentation." & newline & newline end if bodyText = bodyText & "Name: " & Request.Form("first_name") & " " & Request.Form("last_name") & newline bodyText = bodyText & "Title: " & Request.Form("title") & newline bodyText = bodyText & "Phone: (" & Request.Form("phone1") & ") " & Request.Form("phone2") & "-" & Request.Form("phone3") & newline bodyText = bodyText & "E-Mail: " & Request.Form("email") & newline bodyText = bodyText & "Company: " & Request.Form("company") & newline bodyText = bodyText & "Address: " & newline bodyText = bodyText & " " & Request.Form("addr1") & newline bodyText = bodyText & " " & Request.Form("city") & newline bodyText = bodyText & " " & Request.Form("state") & newline bodyText = bodyText & " " & Request.Form("zip") & newline & newline if Request.Form("newsletter") = "Y" then bodyText = bodyText & "Put me on your mailing list to receive Communication ConnXtions - XL's quarterly newsletter." & newline & newline end if if Request.Form("email_list") = "Y" then bodyText = bodyText & "Put me on your e-mail list to receive a link to X-TRA - XL's quick byte of information to keep you in the know." & newline & newline end if ' send email dim strTo dim strFrom dim strSubject dim objSendMail strTo = "ecampbell@xlcommunications.com" strFrom = Request.ServerVariables("SERVER_NAME") strSubject = "XL Capabilities Interest" dim Mailer Set Mailer = Server.CreateObject("SMTPsvg.Mailer") Mailer.RemoteHost = "mailhub.registeredsite.com" 'Mailer.FromAddress = CStr(Request.Form("email")) Mailer.FromAddress = "ecampbell@xlcommunications.com" Mailer.AddRecipient "", CStr(strTo) Mailer.Subject = CStr(strSubject) Mailer.BodyText = CStr(bodyText) if Mailer.SendMail then Set Mailer = Nothing 'redirect to thanks for the info page Response.Redirect("thanks.htm") else Response.Write "Mail send failure. Error was " & Mailer.Response end if Set Mailer = Nothing end if %>
|