%@ LANGUAGE="VBScript" %> <% SUB sendmail( fromWho, toWho, Subject, Body ) Dim objCDO Dim iConf Dim Flds Const cdoSendUsingPort = 2 Set objCDO = Server.CreateObject("CDO.Message") Set iConf = Server.CreateObject("CDO.Configuration") Set Flds = iConf.Fields With Flds .Item(cdoSendUsingMethod) = cdoSendUsingPort .Item(cdoSMTPServer) = "mail-fwd" .Item(cdoSMTPServerPort) = 25 .Item(cdoSMTPconnectiontimeout) = 10 .Update End With Set objCDO.Configuration = iConf objCDO.From = fromWho objCDO.To = toWho objCDO.Subject = Subject objCDO.TextBody = Body objCDO.Send END SUB %> <% 'Set file I/O constants. Const ForReading = 1 Const ForWriting = 2 Const ForAppending = 8 'Map the file name to the physical path on the server. filename = "bookings.txt" path = Server.MapPath(".") & "\data\" & filename 'Get requested operation, if any. operation = Request.Querystring("operation") 'initialize msgbox, bodytext - indicator for paging back if there's an error message = "" bodytext = "" Validated_Form = true if operation = "append" then Validated_Form = true 'replace comma with nothing because text file is comma delimited 'Get requested information, if any. txtReferral = CStr(Request.Form("referral")) txtOther = CStr(Trim(Replace(Request.Form("other"),",",""))) txtFirstName = Trim(Replace(Request.Form("firstname"),",","")) txtFirstName = Trim(txtFirstName) ' remove any spaces 'check to see if empty If len(txtFirstName)<1 Then operation = "" Validated_Form = false message = message & "Please enter your first name." & vbCrLf End If txtLastName = Trim(Replace(Request.Form("lastname"),",","")) txtLastName = Trim(txtLastName) ' remove any spaces 'check to see if empty If len(txtLastName)<1 Then Validated_Form = false operation = "" message = message & "Please enter your last name." & vbCrLf End If txtCompany = Trim(Replace(Request.Form("company"),",","")) txtAddress = Trim(Replace(Request.Form("address"),",","")) txtCity = Trim(Replace(Request.Form("city"),",","")) txtState = Trim(Replace(Request.Form("state"),",","")) txtZip = Trim(Replace(Request.Form("CityStateZip"),",","")) txtHomePhone = Trim(Replace(Request.Form("home phone"),",","")) txtWorkPhone = Trim(Replace(Request.Form("work phone"),",","")) txtCellPhone = Trim(Replace(Request.Form("cell phone"),",","")) txtFax = Trim(Replace(Request.Form("fax"),",","")) txtEmail = Trim(Replace(Request.Form("email"),",","")) txtEmail = Trim(txtEmail) ' remove any spaces 'check to see if empty 'If len(txtEmail)<1 Then 'operation = "" 'message = message & "Please enter your email." & vbCrLf 'Validated_Form = false 'End If 'check if valid email format IF len(txtEmail)<1 OR InStr(txtEmail,"@")=0 THEN Validated_Form = false operation = "" ' set operation so no appending is done message = message & "Please enter valid email." & vbCrLf END IF txtEvent = Trim(Replace(Request.Form("event"),",","")) txtPerformDate = Trim(Replace(Request.Form("performdate"),",","")) txtShowTime = CStr(Trim(Replace(Request.Form("showtime"),",",""))) txtShowName = Trim(Replace(Request.Form("showname"),",","")) txtShowLength = Trim(Replace(Request.Form("showlength"),",","")) txtShowLocation = Trim(Replace(Request.Form("ShowLocation"),",","")) txtShowAddress = Trim(Replace(Request.Form("ShowAddress"),",","")) txtShowCity = Trim(Replace(Request.Form("ShowCity"),",","")) txtShowZipCode = Trim(Replace(Request.Form("ShowZipCode"),",","")) txtShowPhone = Trim(Replace(Request.Form("ShowPhone"),",","")) txtCardName = Trim(Replace(Request.Form("card name"),",","")) txtCardNumber = Trim(Replace(Request.Form("card number"),",","")) txtCardNumber = Replace(txtCardNumber, " ", "") txtCardNumber = Replace(txtCardNumber, "-", "") If Len(txtCardNumber) <> 16 Then Do While Len(txtCardNumber) <> 16 txtCardNumber = txtCardNumber & "0" Loop End If txtCardNumber = Replace(txtCardNumber, "-", "") If Len(txtCardNumber) <> 16 Then Do While Len(txtCardNumber) <> 16 txtCardNumber = txtCardNumber & "0" Loop End If one = Left(txtCardNumber,4) 'Mid(StringToPullFrom, CharToStartWith[, LengthOfCharsToPull]) two = Mid(txtCardNumber, 5, 4) three = Mid(txtCardNumber, 9, 4) four = Right(txtCardNumber,4) txtCardNumber = one & "-" & two & "-" & three & "-" & four txtExpires = Trim(Replace(Request.Form("expires"),",","")) txtAmount = Trim(Replace(Request.Form("amount"),",","")) txtSiteEvaluation = Trim(Replace(Request.Form("siteevaluation"),",","")) txtNotes = Trim(Replace(Request.Form("notes"),",","")) end if if operation = "append" then if Validated_Form = false then bodytext = "history.back()" message = message end if end if %>
|
<% 'Perform the request operation. if operation = "create" then CreateFile(path) ReadFile(path) '----------------------------Email------------------------ fromWho = "bookings@haynesmarionettes.com" ' TRIM( Request.Form( "fromWho") ) toWho = "franklin@haynesmarionettes.com" 'TRIM( Request.Form( "toWho") ) 'toWho = "giridhar9866637837@gmail.com" 'TRIM( Request.Form( "toWho") ) Subject = "Guest Booking Notification"'TRIM( Request.Form( "Subject" ) ) Body = "You have received an online booking." 'TRIM( Request.Form( "Body") ) If toWho <> "" THEN sendMail fromWho, toWho, Subject, Body 'Cleanup Set ObjCDO = Nothing Set iConf = Nothing Set Flds = Nothing END IF response.redirect ("/ty.html") elseif operation = "delete" then call DeleteFile(path) elseif operation = "read" then call ReadFile(path) elseif operation = "write" then call WriteFile(path) ReadFile(path) '----------------------------Email------------------------ fromWho = "webmaster@haynesmarionettes.com" ' TRIM( Request.Form( "fromWho") ) toWho = "franklin@haynesmarionettes.com" 'TRIM( Request.Form( "toWho") ) 'toWho = "giridhar9866637837@gmail.com" 'TRIM( Request.Form( "toWho") ) Subject = "Guest Booking Notification"'TRIM( Request.Form( "Subject" ) ) Body = "You have received an online booking." 'TRIM( Request.Form( "Body") ) If toWho <> "" THEN sendMail fromWho, toWho, Subject, Body 'Cleanup Set ObjCDO = Nothing Set iConf = Nothing Set Flds = Nothing END IF response.redirect ("/ty.html") elseif operation = "append" then call AppendFile(path) ReadFile(path) '----------------------------Email------------------------ fromWho = "webmaster@haynesmarionettes.com" ' TRIM( Request.Form( "fromWho") ) toWho = "franklin@haynesmarionettes.com" 'TRIM( Request.Form( "toWho") ) 'toWho = "giridhar9866637837@gmail.com" 'TRIM( Request.Form( "toWho") ) Subject = "Guest Booking Notification"'TRIM( Request.Form( "Subject" ) ) Body = "You have received an online booking." 'TRIM( Request.Form( "Body") ) If toWho <> "" THEN sendMail fromWho, toWho, Subject, Body 'Cleanup Set ObjCDO = Nothing Set iConf = Nothing Set Flds = Nothing END IF response.redirect ("/ty.html") elseif operation = "" then ReadFile(path) end if %> |
©2006
- Franklin Haynes Marionettes - all rights reserved
Artwork,
Design and Layout by Franklin Haynes
E-mail
Us!