<% '######## Process Form ######## dim errorsList dim uiName, uiEmail dim errorName, errorEmail uiName = Request("uiName") uiEmail = Request("uiEmail") if(Request("uiFormSubmit") = "true") then if(validateForm()=true) then sendEmail() Response.Redirect("e-newsletter.asp?submitted=true") end if end if function validateForm() if uiName = "" then errorsList = errorsList & "
  • Name
  • " errorName = " class='error-field'" end if if not ValidEmail(uiEmail) then errorsList = errorsList & "
  • E-mail
  • " errorEmail = " class='error-field'" end if if(errorsList<>"") then errorsList = "

    Please check the following mandatory field(s)

    " validateForm = false else validateForm = true end if end function function sendEmail() Dim emailBody emailBody = "Website e-Newsletter subsription request:" & vbcrlf & vbcrlf emailBody = emailBody & "Name: " & uiName & vbcrlf emailBody = emailBody & "Email: " & uiEmail & vbcrlf & vbcrlf emailBody = emailBody & "Submission time/date: " & Now() Dim objMsg Set objMsg = CreateObject("CDO.Message") objMsg.To = "sales@v1air.com" objMsg.From = uiEmail objMsg.Subject = "e-Newsletter subscription" objMsg.TextBody = emailBody objMsg.Send end function function ValidEmail(inputString) 'returns a boolean Set regEx = New RegExp regEx.Pattern = "^[\w-\.]{1,}\@([\da-zA-Z-]{1,}\.){1,}[\da-zA-Z-]{2,3}$" regEx.IgnoreCase = True if not regEx.Test(inputString) then validEmail = false else validEmail = true end if end function '########################################## %> The V-One e-Newsletter will keep you informed of emergency time critical related news // V-One Aviation

    The V-One e-Newsletter will keep you informed of emergency time critical logistics related news, as well as the latest information about our company and services.

    In subscribing to the V-One e-Newsletter, I acknowledge that I will be added to V-One's confidential database and will regularly receive email communications.

    VIEW LATEST eNEWSLETTER - SEP 2006

    Subscribe to the V-One e-Newsletter

    e-Newsletter subscription

    <%if Request("submitted") = "true" then %>

    Thank you. You have succesfully subscribed to our e-Newsletter.

    <% else %>
    <%=errorsList%>
    />
    />

    Fields marked * are mandatory

    <% end if %>