<% Option Explicit '--- You can change these Const EMAIL_TO = "david@westpointscotland.com" Const EMAIL_FROM = "website@westpointscotland.com" Const EMAIL_SUBJECT = "Website Enquiry Form" Const MAIL_HOST = "127.0.0.1" '--- End - You can change these Dim iCommandID, bErrors, stErrorString, bEmailSent Dim stName, stCompany, stPosition, stAddress, stEmail, stTelephone, stRequirements, stNumberToDress, stBody Dim sch, cdoConfig, cdoMessage iCommandID = 0 If Request.Form("CommandID").Count > 0 Then iCommandID = CLng(Request.Form("CommandID")) Select Case iCommandID Case 2 With Request.Form stName = .Item("Name") stCompany = .Item("Company") stPosition = .Item("Position") stAddress = .Item("Address") stEmail = .Item("Email") stTelephone = .Item("Telephone") stRequirements = .Item("Requirements") stNumberToDress = .Item("Looking_to_dress") End With If Len(stName) < 3 Then AddError "Please enter your Name" If Len(stCompany) < 2 Then AddError "Please enter your Company Name" If Not checkValidEmail(stEmail) Then AddError "The email address you have supplied is not valid" If stNumberToDress = "x" Then AddError "Please select how many people you are looking to dress" If Not bErrors Then stBody = "Hello" & vbNewLine & vbNewLine & "A visitor to the Westpoint Website has just completed the Enquiry Form. Below are the details of their enquiry." & vbNewLine & vbNewLine & String(70, "-") & vbNewLine & vbNewLine & _ "Name: " & vbTab & stName & vbNewLine & _ "Company Name: " & vbTab & stCompany & vbNewLine If Len(stPosition) > 0 Then stBody = stBody & "Position: " & vbTab & stPosition & vbNewLine If Len(stAddress) > 0 Then stBody = stBody & "Address: " & vbTab & Replace(stAddress, vbCrLf, ", ") & vbNewLine stBody = stBody & "Email Address: " & vbTab & stEmail & vbNewLine If Len(stTelephone) > 0 Then stBody = stBody & "Telephone: " & vbTab & stTelephone & vbNewLine stBody = stBody & vbNewLine & "Requirements" & vbNewLine & "------------" & vbNewLine & stRequirements & vbNewLine & vbNewLine & _ "Looking to dress: " & vbTab & stNumberToDress & vbNewLine & vbNewLine & String(70, "-") sch = "http://schemas.microsoft.com/cdo/configuration/" Set cdoConfig = CreateObject("CDO.Configuration") With cdoConfig.Fields .Item(sch & "sendusing") = 1 ' pickup, 2 ' cdoSendUsingPort .Item(sch & "smtpserver") = MAIL_HOST .update End With Set cdoMessage = CreateObject("CDO.Message") With cdoMessage Set .Configuration = cdoConfig .From = EMAIL_FROM .To = EMAIL_TO .Subject = EMAIL_SUBJECT .TextBody = stBody .Send End With Set cdoMessage = Nothing Set cdoConfig = Nothing bEmailSent = True End If End Select %> Westpoint Distributors Ltd - Where Safety Comes First
HomeCompany ProfileProductsServicesRequest A QuoteNewsContact Us
Protective Clothing
Foul Weather Jackets
Waterproof Suits
Hi - Visibility Garments
Safety Footwear
Head Protection
Eye & Face Protection
Respiratory Protection
Hearing Protection
Hand Protection
Corporate Clothing
Polo's, Sweats & Fleeces
Warning Signs
Fall Arrest Devices
 
<% If bErrors Then %> <% End If If bEmailSent Then %> <% Else %> <% End If ' bEmailSent %>
Please tell us how to get in touch with you.

The following problems were detected:
    <%=stErrorString%>
Thank you, your message has been sent and we will contact you shortly.
Please note fields marked with an asterisk (*) are required.

<% If Not bEmailSent Then %>
Name: *
Company: *
Position:
Address:
E-mail: *
Telephone:
Please tell us what you are looking for.
How many people are you looking to dress? *
<% Else %> <% End If %>
 
Westpoint Distributors (Scotland) Ltd
9 Underwood Road
Paisley PA3 1TE
Renfrewshire
Tel: 0141 889 6605
Fax: 0141 840 1181
Email: info@westpointscotland.com