<% recaptcha_challenge_field = Request("recaptcha_challenge_field") recaptcha_response_field = Request("recaptcha_response_field") recaptcha_public_key = "6LeGcbwSAAAAAJUgFCD9KejrRVQC66lFyPppMD7T" ' your public key recaptcha_private_key = "6LeGcbwSAAAAAB8jQkMMaoRtgs8qRk0pTMVGSwzY" ' your private key ' returns the HTML for the widget function recaptcha_challenge_writer() recaptcha_challenge_writer = "" & _ "" & _ "" end function ' returns "" if correct, otherwise it returns the error response function recaptcha_confirm(rechallenge,reresponse) Dim VarString VarString = _ "privatekey=" & recaptcha_private_key & _ "&remoteip=" & Request.ServerVariables("REMOTE_ADDR") & _ "&challenge=" & rechallenge & _ "&response=" & reresponse Dim objXmlHttp Set objXmlHttp = Server.CreateObject("Msxml2.ServerXMLHTTP") objXmlHttp.open "POST", "http://www.google.com/recaptcha/api/verify", False objXmlHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" objXmlHttp.send VarString Dim ResponseString ResponseString = split(objXmlHttp.responseText, vblf) Set objXmlHttp = Nothing if ResponseString(0) = "true" then 'They answered correctly recaptcha_confirm = "" else 'They answered incorrectly recaptcha_confirm = ResponseString(1) end if end function server_response = "" newCaptcha = True if (recaptcha_challenge_field <> "" or recaptcha_response_field <> "") then server_response = recaptcha_confirm(recaptcha_challenge_field, recaptcha_response_field) newCaptcha = False end if %> LMU: Information Services >> Help Desk >> Pathway Site Request Form
Admissions

Information Services >> Help Desk




<% if server_response <> "" or newCaptcha then %> <% if newCaptcha = False then %> <% response.write("

Captcha response invalid. Please resubmit the form.

") %> <% end if %>

ITV Video Conference Request






* The Captcha is required, this is to reduce bot form submissions. <%=recaptcha_challenge_writer()%>




<% else %> <% 'Using CDOsys with Basic authentication in Classic ASP 'assumes form includes at least: 'form_name - senders name 'form_mail - senders email 'form_subject 'form_body 'Because this code uses authentication, it requires access to a mailbox on your account. 'reports 'mailFailed' - true or false 'and 'strErr' - Mail server error response 'and 'strErrCode' - Mail server numerical error response (as string) 'dimension all variables (essential if 'option expicit' used) dim strHost, strErr, mailFailed dim strBody, strName, strMail dim strSubject, strFrom, strTo, strCC, strBCC, strReplyTo dim strAutoMailbox, strEmPass 'modify for yourDomain ********************************************* 'your mail server strHost = "10.10.1.11" 'address of your outgoing mailbox 'this will appear in the headers as the originating mailbox 'strAutoMailbox = "formmail@ourarea.com" 'password for your AutoMailbox 'strEmPass = "1234" 'the name and email that appears in the "From:" line (can be different to above) 'strFrom = strName & "<" & strMail & ">" 'where to send the mail strTo = "lmuhelpdesk@lmunet.edu" 'where to send copies (optional) strCC = "ishelpdesk@lmunet.edu" strBCC = "" '************************************************* ********************* 'collect details from the form *************************** strName = Request.Form("Name") strMail = Request.Form("Email") 'create the "Reply To:" i.e. the name and email of the form user strFrom = strName & "<" & strMail & ">" strReplyTo = strName & "<" & strMail & ">" 'create subject string strSubject = Request.Form("form_subject") 'create Body string strBody = strBody & "***************************************************" & vbCrLf strBody = strBody & "Requestor: " & Request.Form("Name") & vbcrLf & vbcrLf strBody = strBody & "Requestor Phone: " & Request.Form("Phone") & vbcrLf& vbcrLf strBody = strBody & "Requestor Email: " & Request.Form("Email") & vbcrLf & vbcrLf strBody = strBody & "Meeting Date: " & Request.Form("date") & vbcrLf & vbcrLf strBody = strBody & "Start Time: " & Request.Form("Start") & vbcrLf & vbcrLf strBody = strBody & "End Time: " & Request.Form("End") & vbcrLf & vbcrLf strBody = strBody & "Room 1: " & Request.Form("Room1") & vbcrLf & vbcrLf strBody = strBody & "Room 2: " & Request.Form("Room2") & vbcrLf & vbcrLf StrBody = strBody & "Room 3: " & Request.Form("Room3") & vbcrLf & vbcrLf strBody = strBody & "Comments: " & Request.Form("Comments") & vbcrLf & vbcrLf 'Adds the referring page and the IP details of sender to the mail body (optional) 'strBody = strBody & "Requested from " & Request.ServerVariables("http_referer") & vbCrLf 'strBody = strBody & "Requested by " & Request.ServerVariables("REMOTE_ADDR") _ '& " at " & Request.ServerVariables("REMOTE_HOST") _ '& ". Server time: " & time & " " & Date & " " & vbcrlf 'note the '_' continuation character, if spreading code to the next line for readability 'send the mail ************************************************** ******* 'initialise the error response string strErr = "" 'Const cdoBasic = 1 'Use basic (clear-text) authentication. Const cdoSendUsingPort = 2 Dim iMsg Dim iConf Dim Flds Dim sMsg On Error Resume Next set iMsg = CreateObject("CDO.Message") set iConf = CreateObject("CDO.Configuration") Set Flds = iConf.Fields With Flds '.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic '.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = strAutoMailbox '.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = strEmPass .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strHost .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 100 .Update End With With iMsg Set .Configuration = iConf .To = strTo 'To .From = strFrom 'From: if strReplyTo <> "" then .ReplyTo = strReplyTo 'add ReplyTo: if exists end if if strCC <> "" then .CC = strCC 'add CC if exists end if if strBCC <> "" then .BCC = strBCC 'add BCC if exists end if .Subject = strSubject 'add the subject .TextBody = strBody 'add the body (this is plain text) .Send 'send the mail strErr = Err.description 'response (empty if no problems) 'note: Err.number was not available when tested live End With 'clean up Set iMsg = Nothing Set iConf = Nothing Set Flds = Nothing 'prepare report flag and string if strErr = "" then mailFailed = false strErr = "Your mail has been sent." else mailFailed = true end if %> <% 'report result 'response.write (strErr) Response.Redirect "http://www.lmunet.edu/is/thanks.asp" %> <%end if%>