%option explicit%> <% dim my_to, my_toaddress,my_system,my_from,my_fromaddress,my_subject,mailtype dim mailer, my_attachment dim customeradmin '********************************************************** ' adds customer Contact form ' Display compnay information and allows customer to send messages ' ' Version 5.00 March 22, 2003 ' Nov 19, 2003 fix closedatabase '********************************************************* Dim sAction, dbtable Dim strPassword1, strPassword2 dim body, strsubject,strcomment setsess "currenturl","shopcustcontact.asp" If getconfig("init")="" then dim conn shopopendatabase conn shopclosedatabase conn end if sAction=Request("Action") if saction="" then sAction=Request("Action.x") end if If getconfig("xcontactform")<>"Yes" then ' shoperror getlang("LangCustNotAllowed") end if Serror="" ShopPageHeader If sAction = "" Then DisplayForm Else ValidateData() if sError = "" Then SendMailToMerchant strsubject WriteInfo else DisplayForm end if end if ShopPageTrailer Sub DisplayForm() Displayerrors DisplayCompanyinfo Response.Write("
" End Sub Sub ValidateData strFirstname = Request.Form("strFirstname") strLastname = Request.Form("strLastname") strEmail = Request.Form("strEmail") strcomment=request("strcomment") strsubject=request("strsubject") strcompany=request("strcompany") ValidateMininumInfo End Sub Sub WriteInfo shopwriteheader getlang("LangTellaFriendInfo") End Sub Sub DisplayErrors if sError<> "" then shopwriteError SError Serror="" end if end Sub Sub SendMailToMerchant (isubject) dim acount dim my_attachment, htmlformat htmlformat="Text" my_attachment="" mailtype=getconfig("xemailtype") my_from=strlastname my_fromaddress=stremail my_toaddress=getconfig("xemail") my_to=getconfig("xemailname") my_system=getconfig("xemailsystem") my_subject=isubject Body="" body=body & shopdateformat(date(),getconfig("xdateformat")) & " " & time()& vbcrlf & vbcrlf Body=Body & Strfirstname & " " & strLastname & vbcrlf Body=body & stremail & vbcrlf if strcompany<>"" then Body=body & getlang("LangCustcompany") & " " & strcompany & vbcrlf end if body=body & vbcrlf body=body & strcomment acount=0 ExecuteMail mailtype,My_from,my_fromaddress,my_to,my_toaddress,my_subject,body,htmlformat,my_attachment,acount If getconfig("xdebug")="Yes" then debugwrite "Mailing to: " & my_to & "(" & my_toaddress & ") from " & strlastname & " " & stremail end if end sub Sub DisplayMinimumForm Response.Write(TableDef) CreateCustRow getlang("LangCustFirstname"), "strfirstname", strFirstname,"Yes" CreateCustRow getlang("LangCustLastname"), "strLastname", strLastname,"Yes" CreateCustRow getlang("LangCustEmail"), "strEmail", strEmail, "Yes" CreateCustRow getlang("LangSubject"), "strsubject", strSubject, "Yes" CreateCustRow getlang("LangCustCompany"), "strcompany", strcompany, "No" Response.Write(TableDefEnd) Shopwriteheader getlang("LangCheckoutadditional") Response.write "" & "
" end sub Sub ValidateMininumInfo If strFirstname = "" Then sError = sError & getlang("LangCustFirstname") & getlang("LangCustrequired") & "