% Const DATE_DELIMITER = "'" %>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
![]() |
||||||||||||||
Your entry for " & ErrFld & " field is " & _ "inappropriate! " & _ "Try again " &vbCrLf Err.Clear End If On Error Goto 0 If strErrorMsg <> "" Then ' Show the error message that got us here! Response.Write strErrorMsg Else ' Open connection to the DB Set cnnFormToDB = Server.CreateObject("ADODB.Connection") cnnFormToDB.Open conn ' Build our SQL String strSQL = "" strSQL = strSQL & "INSERT INTO Inquiry " strSQL = strSQL & "(Name,Company,Street,City,State,pCode,Country,phone,fax,Email,addDate,knoway,message) " & vbCrLf strSQL = strSQL & "VALUES (" strSQL = strSQL & "'" & strName & "'" strSQL = strSQL & ", " strSQL = strSQL & "'" & strCompany & "'" strSQL = strSQL & ", " strSQL = strSQL & "'" & strStreet & "'" strSQL = strSQL & ", " strSQL = strSQL & "'" & strCity & "'" strSQL = strSQL & ", " strSQL = strSQL & "'" & strState & "'" strSQL = strSQL & ", " strSQL = strSQL & "'" & strZip & "'" strSQL = strSQL & ", " strSQL = strSQL & "'" & strCountry & "'" strSQL = strSQL & ", " strSQL = strSQL & "'" & strTel & "'" strSQL = strSQL & ", " strSQL = strSQL & "'" & strFax & "'" strSQL = strSQL & ", " strSQL = strSQL & "'" & strEmail & "'" strSQL = strSQL & ", " strSQL = strSQL & DATE_DELIMITER & Now & "'" strSQL = strSQL & ", " strSQL = strSQL & "'" & strHear & "'" strSQL = strSQL & ", " strSQL = strSQL & "'" & strMsg & "'" strSQL = strSQL & ");" cnnFormToDB.Execute strSQL, adCmdText Or adExecuteNoRecords ' Dispose of the CONN object cnnFormToDB.Close Set cnnFormToDB = Nothing %>Thanks for submitting your information to us!Our customer representative will contact you shortly. <% '========web mail procedure======= Dim strTo, strSubject, strBody 'Strings for recipient, subject, boby Dim objCDOMail 'The CDO object strTo = Request.Form("iqemail") strSubject = "Quick reply to customer inquiry" strBody="Dear " & strName & "," strBody = strBody & vbCrLf & vbCrLf strBody=strBody & "Thank you for inquiry about our business, our support team will contact you shortly." strBody = strBody & vbCrLf & vbCrLf strBody = strBody & "unitedcontact.com" strBody = strBody & vbCrLf & vbCrLf strBody = strBody & "Following text is what you entered in our inquiry form for the referenece to our customer representative." strBody = strBody & vbCrLf & vbCrLf strBody= strBody & "Name: " & strName & vbCrLf strBody= strBody & "Company: " & strCompany & vbCrLf strBody= strBody & "Street: " & strStreet & vbCrLf strBody= strBody & "City: " & strCity & vbCrLf strBody= strBody & "State: " & strState & vbCrLf strBody= strBody & "Postal Code: " & strZip & vbCrLf strBody= strBody & "Country: " & strCountry & vbCrLf strBody= strBody & "Telephone: " & strTel & vbCrLf strBody= strBody & "Fax: " & strFax & vbCrLf strBody= strBody & "Email: " & strEmail & vbCrLf strBody= strBody & "How did you hear about us?: " & strHear & vbCrLf strBody= strBody & "Message: " & strMsg & vbCrLf Set objCDOMail = Server.CreateObject("CDONTS.NewMail") objCDOMail.From = "info@unitedcontact.com" objCDOMail.To = strTo objCDOMail.Subject = strSubject objCDOMail.Body = strBody objCDOMail.Cc = "info@unitedcontact.com" objCDOMail.Send Set objCDOMail = Nothing 'Response.Write "The quick reply message was sent to " & strTo & "! "
End If
%>
<% ' Only functions and subs follow!
Function IsValidEmail(strEmail)
Dim bIsValid
bIsValid = True
If Len(strEmail) < 5 Then
bIsValid = False
Else
If Instr(1, strEmail, " ") <> 0 Then
bIsValid = False
Else
If InStr(1, strEmail, "@", 1) < 2 Then
bIsValid = False
Else
If InStrRev(strEmail, ".") < InStr(1, strEmail, "@", 1) + 2 Then
bIsValid = False
End If
End If
End If
End If
IsValidEmail = bIsValid
End Function
%>
<% end if %> |
||||||||||||||