<% dim error_message dim form_error dim missing_field dim invalid_email error_message = "Your enquiry was not sent becuase the form contained the following errors:
" form_error = false missing_field = false invalid_email = false if(request.Form("form_sent") <> "") then Function isValidEmail(myEmail) dim isValidE dim regEx isValidE = True set regEx = New RegExp regEx.IgnoreCase = False regEx.Pattern = "^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$" isValidE = regEx.Test(myEmail) isValidEmail = isValidE End Function if(request.Form("Enquiry") = "") then form_error = true missing_field = true end if if(request.Form("Name") = "") then form_error = true missing_field = true end if if(request.Form("Email") = "") then form_error = true missing_field = true end if if not isValidEmail(request.Form("Email")) then form_error = true invalid_email = true end if if missing_field = true then error_message = error_message & "One or more compulsory fields(*) were not supplied
" end if if invalid_email = true then error_message = error_message & "An invalid email address was supplied" end if if(form_error = false) then 'get form data dim from from = request.Form("Name") dim message message = request.Form("Enquiry") dim tel tel = request.Form("Telephone") dim email email = request.Form("Email") dim chkTel chkTel = request.Form("chkTel") dim chkEmail chkEmail = request.Form("chkEmail") dim MessageContent MessageContent = "Name: " & from & "
" MessageContent = MessageContent & "Tel No: " & tel & "
" MessageContent = MessageContent & "Email: " & email & "
" MessageContent = MessageContent & "Contact by: " & chkTel & " " & chkEmail & "
" MessageContent = MessageContent & "Message :
" MessageContent = MessageContent & message 'submit data to email Set Mail = Server.CreateObject("SMTPsvg.Mailer") Mail.FromName = company Mail.FromAddress = email Mail.RemoteHost = "mrvnet.kundenserver.de" Mail.AddRecipient "The ISAC Clinic","info@action-media.co.uk" Mail.Subject = "The ISAC Clinic Enquiry Form" Mail.BodyText = MessageContent Mail.ContentType = "text/html" if Mail.SendMail then response.redirect("enquiry_sent.htm") else response.redirect("enquiry_error.htm") end if Set Mail = nothing end if end if %> Contact The ISAC Clinic
Please send us an enquiry and we will respond quickly
  Your Name:: *
  Address::
  Tel No:: *
  Email:: *
  Contact method:   Telephone    Email:
  Please write any comments or queries in here:
 

<% if(form_error = true) then response.Write(error_message) end if %>

The ISAC Clinic    Telephone: 01494 673478       Email: info@isac-clinic.co.uk