<%@LANGUAGE="VBSCRIPT"%> Smart-Hose
<% '******************************************************* 'Form Validation '================================= 'All fields are acted as required ' except those the NAME of which ' is in this string variable: '================================= exceptions = Array("address","Phone_Number","Additional_Notes","Supplier","Delivery", "Facebook", "Twitter", "LinkedIn", "Smart-Hose_Website", "Search_Engine", "Search_Engine_Choice") '================================= 'NAME of the e-mail field is ' stored in this string variable: '================================= emailField = "email" '================================= 'Variables '================================= dim errorMessage, badItem, inputArray() : badItem=-1 redim inputArray(50,2) '================================= 'Get all what is submitted '================================= IF request.Form.Count > 0 THEN execute("const numberOfFields =" & request.Form.Count) execute("redim inputArray("&numberOfFields&",2)") FOR i = 1 TO request.Form.Count inputArray(i,1) = request.Form.Key(i) inputArray(i,2) = request.Form.Item(i) NEXT validate ELSEIF request.QueryString.Count > 0 THEN execute("const numberOfFields =" & request.QueryString.Count) execute("redim inputArray("&numberOfFields&",2)") FOR i = 1 TO request.QueryString.Count inputArray(i,1) = request.QueryString.Key(i) inputArray(i,2) = request.QueryString.Item(i) NEXT validate END IF SUB validate '================================= 'Check for empty fields '================================= FOR i = 1 TO numberOfFields isException = False IF inputArray(i,2)="" THEN FOR j = 0 to UBound(exceptions) IF inputArray(i,1) = exceptions(j) THEN isException = TRUE NEXT IF NOT isException THEN badItem = i errorMessage = "At least one of the required fields is left empty." EXIT SUB END IF END IF isException = False NEXT '================================= 'Check email address for basic ' errors '================================= FOR i = 1 TO numberOfFields IF emailField=inputArray(i,1) THEN validationResult = validateEmail(inputArray(i,2)) IF validationResult <> "" THEN errorMessage = validationResult badItem = i END IF END IF NEXT END SUB FUNCTION validateEmail(strAddress) IF InStr(strAddress,"@") < 2 THEN validateEmail = "Email address must contain ""@"" sign." ELSEIF InStr(Right(strAddress,Len(strAddress)-InStr(strAddress,"@")),".") < 2 OR InStr(Right(strAddress,Len(strAddress)-InStr(strAddress,"@")),".") = Len(strAddress)-InStr(strAddress,"@") THEN validateEmail = "Email address must contain ""."" sign." 'ELSE 'host = Right(strAddress,Len(strAddress)-InStr(strAddress,"@")) 'IF NOT MXLookUp(host) THEN validateEmail = "Bad email address." END IF END FUNCTION FUNCTION MXLookUp(host) MXLookUp = False Dim objXMLHTTP,strResult Set objXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP") objXMLHTTP.Open "Get", _ "http://examples.softwaremodules.com/IntraDns.asp?domainname=" & host & "&Submit=Submit&t_mx=1", False objXMLHTTP.Send strResult = objXMLHTTP.ResponseText strResult = Mid(strResult,InStr(strResult,"(MX) for "),100) strResult = Mid(strResult,Instr(strResult,". Items Returned: ")+35,1) IF CInt(strResult) > 0 THEN MXLookUp = TRUE ELSE MXLookUp = FALSE END IF END FUNCTION %> <% IF errorMessage<>"" THEN %>

There was an error with your form: <%=errorMessage%>


<% ELSEIF request.form.count = 0 THEN %>

If you would like pricing on any of our hose assemblies please fill out the quote request form:


Fields with an * need to be filled out.


<% ELSE SendMailCDO %>

Thank you, a representative from our company will contact you shortly!

<% Response.End 'SendMailCDO END IF %> <% Sub SendMailCDO Dim objMessage 'As New CDO.Message 'Create CDO message object Set objMessage = CreateObject("CDO.Message") Dim aTo Dim aFrom Dim Subject Dim TextBody Dim form_subject aTo = "sales@smarthose.com;cybereagle@verizon.net" aFrom = "sales@smarthose.com" Subject = "Request A Quote" form_subject = Subject 'Set email adress, subject And body '******************************************************* 'Get all form elements and structure the e-mail '******************************************************* FOR x = 1 TO Request.Form.Count IF Request.Form.Key(x) = "mail_from" OR Request.Form.Key(x) = "mail_to" OR Request.Form.Key(x) = "mail_cc" OR Request.Form.Key(x) = "mail_bcc" OR Request.Form.Key(x) = "mail_subject" OR Request.Form.Key(x) = "mail_importance" OR Request.Form.Key(x) = "mail_redirect" OR Request.Form.Key(x) = "mail_send" OR Request.Form.Key(x) = "Submit" THEN form_variables = form_variables ELSE form_variables = form_variables & Request.Form.Key(x) & ": " & vbcrlf & Request.Form.Item(x) & vbcrlf & vbcrlf END IF NEXT DIM body_text body_text = vbcrlf & "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" & vbcrlf body_text = body_text & form_subject & vbcrlf body_text = body_text & "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" & vbcrlf & vbcrlf body_text = body_text & form_variables body_text = body_text & "Sent from: " & vbcrlf & Request.ServerVariables("HTTP_REFERER") & vbcrlf & vbcrlf body_text = body_text & "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" & vbcrlf body_text = body_text & "Script Provided by TeleQ Network Solutions" & vbcrlf body_text = body_text & "http://www.teleqns.net" & vbcrlf TextBody = body_text objMessage.To = aTo objMessage.Subject = Subject objMessage.TextBody = TextBody 'Set sender address If specified. If Len(aFrom) > 0 Then objMessage.From = aFrom 'Send the message objMessage.Send End Sub %>

Name: * />


Company Name: * />


Company Address: * />


Phone Number: />


Email: * />


Would you prefer a phone call or an email: * />

 


Critical Hose Information


S Size-Overall Length: * />


T Temperature: * />


A Application: * />


M Media: * />


P Pressure: * />


E End Configuration: * />


D Delivery: />


Additional Notes. Please provide us with as much information about your application as possible: />


Please tell us the name of your current hose assembly supplier: />


How did you hear about Smart-Hose?  Facebook   Twitter   LinkedIn   Smart-Hose Website  

                                        ;                      Search Engine (specify)   />


Smart-Hose - Corporate Headquarters
701 Ashland Ave Bldg 22 Suite 11
Folcroft, Pa 19032
Tel-215-730-9000
Toll Free-877-356-6278
Fax-215-730-0558
Sales@SmartHose.com

Smart-Hose Technologies Asia
3I/1, Meitingxuan, Millennium Garden, Buji,
Shenzhen, China 518112
Tel: +86 755 22006517
Fax: +86 755 84707018
Mobile: +86 13760374757
Skype ID: wilson_wyw
wwang@smarthose.com

Smart-Hose India
T-33, Okhla Industrial Area
Phase - II, New Delhi, 110 020 India
Tel- +91 11 41435370
Fax - +91 11 41435373
IndiaSales@SmartHose.com

Smart-Hose Latin America
Carrera 34 #10-445
ACOPI Cali, Colombia
Sur America
Tel + 57 26644703 X113
Latinamericasales@Smarthose.com