%@ LANGUAGE = "VBScript" %>
<%
'-----------------------------------------------------------
' ASPilot.com - Newsletter
' ------------------------------
' Copyright © 2004 Spliethof Inc
'
' This file lists all the newsletter interface for the
' shopping cart.
PilotInitialize
GetCurrentCustomer
MarkCurrentCustomerActive
mode = EStr(Request.QueryString("mode"))
sorry = "
Sorry, nothing was found.
| Tip: If browsing is not yielding the results you are looking for, why not try using our search engine? |
"
'-----------------------------------------------------------
' GetCountriesDropDownRS
' ----------------------
' Gets all the countries in a fast recordset.
'-----------------------------------------------------------
Function GetCountriesDropDownRS()
Set GetCountriesDropDownRS = OpenFastRS("SELECT Code2, Country FROM tblCountries ORDER BY Country ASC")
End Function
'-----------------------------------------------------------
' GetCountryByCode2RS
' -------------------
' Gets a country records by its Code2.
'-----------------------------------------------------------
Function GetCountryByCode2RS(strCode2)
Set GetCountryByCode2RS = OpenFastRS("SELECT * FROM tblCountries WHERE Code2 " & CSQLEq(strCode2))
End Function
If Not PilotPageBegin("contact", Empty) Then Response.Redirect g.HomePageURL & "pilot.asp"
B2BCheckLogin "contact"
Select Case mode
Case "results"
FNAME = Request.Form("FNAME")
LNAME = Request.Form("LNAME")
EMAIL = Request.Form("EMAIL")
' If ValidEmailAddress(EMAIL) Then
' strSQL = "SELECT MY_EMAIL FROM TBLNEWSLETTER WHERE MY_EMAIL='"&myEmail&"'"
' Set rsU = cnPILOT.Execute(strSQL)
' If rsU.EOF Then
' strSQL = "INSERT INTO TBLNEWSLETTER(MY_EMAIL, THE_DATE, MAILERID) VALUES('"&EMAIL&"', '"&Now()&"', '0')"
' Set rsNL = cnPILOT.Execute(strSQL)
' Set rsNL = Nothing
' End If
' rsU.Close : Set rsU = Nothing
' End If
PHONE = Request.Form("PHONE")
COMMENTS = Request.Form("COMMENTS")
If COMMENTS = "" Then COMMENTS = "No comments entered!"
If ValidEmailAddress(EMAIL) Then
Set rs = GetCountryByCode2RS(Request.Form("countrycode"))
If HasRecords(rs) Then
strCountry = rs("Country")
Else strCountry = "Unknown"
End If
rs.Close: Set rs = Nothing
ReDim FromArray(1), ToArray(1)
'Email to webmaster(s)
FromArray(0) = g.HomeDomain & " Contact Us Page"
FromArray(1) = EMAIL
ToArray(0) = strAttn
ToArray(1) = Request.Form("attn")
BodyText = "Submitted By: "&FNAME&" "&LNAME &vbCrLf
BodyText = BodyText & "Email: mailto:"&EMAIL &vbCrLf
BodyText = BodyText & "Country: "&strCountry&vbCrLf
BodyText = BodyText & "Phone: "&PHONE &vbCrLf
BodyText = BodyText & "Submitted: "&Now &vbCrLf
BodyText = BodyText & "Remote Address: "&Request.ServerVariables("REMOTE_ADDR") &vbCrLf&vbCrLf
BodyText = BodyText & "Comments: "&COMMENTS
SendEMail FromArray, ToArray, 0, BCCArray, "text/plain", g.homeDomain & " Contact Us Page", BodyText, 3
BodyText = "We received the following submission:" &vbCrLf&vbCrLf
BodyText = BodyText & vbCrLf
BodyText = BodyText & "Comments: "&COMMENTS&vbCrLf&vbCrLf
BodyText = BodyText & "We value your questions/comments and will be responding shortly."&vbCrLf
BodyText = BodyText & "--Team "&g("Company_Name")&" "&g.homePageURL
'Auto-response to customer
SendEMail ToArray, FromArray, 0, BCCArray, "text/plain", g("COMPANY_NAME") & " Contact Us Page", BodyText, 3
Else
Response.Redirect g.HomePageURL & "contact.asp?mode=invalid"
End If
Response.Write"
Successful!
We will contact you shortly..
Click here to return home
"
Case "invalid"
Response.Write"
Error!
Email address is not valid
Click here to return to contact page
"
Case Else
ContactDisplay
End Select
TemplateAfterPC
PilotPageEnd
%>