%@ LANGUAGE="VBSCRIPT" %>
<% option explicit %>
<% Response.Buffer = True %>
<%
'Declaring Variables
Dim smtpserver,youremail,yourpassword,Booking_Title,Booking_Name,Booking_Email,Booking_Email2,Booking_Fax,Booking_Tel,Booking_Address
Dim title1,fname1,lname1,mileage1
Dim title2,fname2,lname2,mileage2
Dim title3,fname3,lname3,mileage3
Dim title4,fname4,lname4,mileage4
Dim ticket_type,ticket_visa,airline_type,departuredate,returndate,country,valid,remark
Dim Booking_Subject,Action,IsError
	
' Edit these 3 values accordingly
smtpserver = "mail.e-biz-travel.com"
youremail = "bee@e-biz-travel.com"
yourpassword = "ebiz2005"
	
' Grabbing variables from the form post
Booking_Title = Request.Form("Booking_Title")
Booking_Name = Request.Form("Booking_Name")
Booking_Email = Request.Form("Booking_Email")
Booking_Email2 = Request.Form("Booking_Email2")
Booking_Fax = Request.Form("Booking_Fax")
Booking_Tel = Request.Form("Booking_Tel")
Booking_Address = Request.Form("Booking_Address")
title1 = Request.Form("title1")
fname1 = Request.Form("fname1")
lname1 = Request.Form("lname1")
mileage1 = Request.Form("mileage1")
title2 = Request.Form("title2")
fname2 = Request.Form("fname2")
lname2 = Request.Form("lname2")
mileage2 = Request.Form("mileage2")
title3 = Request.Form("title3")
fname3 = Request.Form("fname3")
lname3 = Request.Form("lname3")
mileage3 = Request.Form("mileage3")
title4 = Request.Form("title4")
fname4 = Request.Form("fname4")
lname4 = Request.Form("lname4")
mileage4 = Request.Form("mileage4")
ticket_type = Request.Form("ticket_type")
ticket_visa = Request.Form("ticket_visa")
airline_type = Request.Form("airline_type")
departuredate = Request.Form("departuredate")
returndate = Request.Form("returndate")
country = Request.Form("country")
valid = Request.Form("valid")
remark = Request.Form("remark")
Booking_Subject = Request.Form("Booking_Subject")
Action = Request.Form("Action")
	
' Used to check that the email entered is in a valid format
Function IsValidEmail(Email)
	Dim ValidFlag,BadFlag,atCount,atLoop,SpecialFlag,UserName,DomainName,atChr,tAry1
	ValidFlag = False
		If (Email <> "") And (InStr(1, Email, "@") > 0) And (InStr(1, Email, ".") > 0) Then
			atCount = 0
			SpecialFlag = False
			For atLoop = 1 To Len(Email)
			atChr = Mid(Email, atLoop, 1)
				If atChr = "@" Then atCount = atCount + 1
				If (atChr >= Chr(32)) And (atChr <= Chr(44)) Then SpecialFlag = True
				If (atChr = Chr(47)) Or (atChr = Chr(96)) Or (atChr >= Chr(123)) Then SpecialFlag = True
				If (atChr >= Chr(58)) And (atChr <= Chr(63)) Then SpecialFlag = True
				If (atChr >= Chr(91)) And (atChr <= Chr(94)) Then SpecialFlag = True
			Next
			If (atCount = 1) And (SpecialFlag = False) Then
				BadFlag = False
				tAry1 = Split(Email, "@")
				UserName = tAry1(0)
				DomainName = tAry1(1)
			If (UserName = "") Or (DomainName = "") Then BadFlag = True
			If Mid(DomainName, 1, 1) = "." then BadFlag = True
			If Mid(DomainName, Len(DomainName), 1) = "." then BadFlag = True
				ValidFlag = True
			End If
		End If
		If BadFlag = True Then ValidFlag = False
		IsValidEmail = ValidFlag
End Function
%>
Air Ticket - Reservation Form ( Powered By E-Biz Travel Co.,Ltd. )
  <%
If Action = "SendEmail" Then
	
	' Here we quickly check/validate the information entered
	' These checks could easily be improved to look for more things
	If IsValidEmail(Booking_Email) = "False" Then
		IsError = "Yes"
		Response.Write("
You did not enter a valid email address.")
	End If
	
	If Booking_Name = "" Then
		IsError = "Yes"
		Response.Write("
You did not enter a Name.")
	End If
	
	If Booking_Tel = "" Then
		IsError = "Yes"
		Response.Write("
You did not enter a Telephone Number.")
	End If
	
	If ticket_type = "" Then
		IsError = "Yes"
		Response.Write("
You did not enter a Ticket Type.")
	End If
	
	If country = "" Then
		IsError = "Yes"
		Response.Write("
You did not enter a City or Country Name.")
	End If
	
End If
	
' If there were no input errors and the action of the form is "SendEMail" we send the email off
If Action = "SendEmail" And IsError <> "Yes" Then
	
	Dim strBody
	
	' Here we create a nice looking html body for the email
	strBody = strBody & "
Booking Form Information submitted at " & Now() &  vbCrLf & "
"
	strBody = strBody & "From http://" & Request.ServerVariables("HTTP_HOST") &  vbCrLf & "
"
	strBody = strBody & "IP " & Request.ServerVariables("REMOTE_ADDR") & vbCrLf & "
"
	
	strBody = strBody & "Subject" & " : " & " " & Replace(Booking_Subject,vbCr,"
") & "
"
	
	strBody = strBody & "Title" & " : " & " " & Replace(Booking_Title,vbCr,"
") & "
"
	strBody = strBody & "Customer Name" & " : " & " " & Replace(Booking_Name,vbCr,"
") & "
"
	strBody = strBody & "Email Address" & " : " & " " & Replace(Booking_Email,vbCr,"
") & "
"
	strBody = strBody & "Email Address" & " : " & " " & Replace(Booking_Email2,vbCr,"
") & "
"
	strBody = strBody & "Fax No" & " : " & " " & Replace(Booking_Fax,vbCr,"
") & "
"
	strBody = strBody & "Telephone No" & " : " & " " & Replace(Booking_Tel,vbCr,"
") & "
"
	strBody = strBody & "Correspondence Address" & " : " & " " & Replace(Booking_Address,vbCr,"
") & "
"
	
	strBody = strBody & "Title (1)" & " : " & " " & Replace(title1,vbCr,"
") & " "
	strBody = strBody & "First Name" & " : " & " " & Replace(fname1,vbCr,"
") & " "
	strBody = strBody & "Last Name" & " : " & " " & Replace(lname1,vbCr,"
") & "
"
	strBody = strBody & "Mileage No" & " : " & " " & Replace(mileage1,vbCr,"
") & "
"
	
	strBody = strBody & "Title (2)" & " : " & " " & Replace(title2,vbCr,"
") & " "
	strBody = strBody & "First Name" & " : " & " " & Replace(fname2,vbCr,"
") & " "
	strBody = strBody & "Last Name" & " : " & " " & Replace(lname2,vbCr,"
") & "
"
	strBody = strBody & "Mileage No" & " : " & " " & Replace(mileage2,vbCr,"
") & "
"
	strBody = strBody & "Title (3)" & " : " & " " & Replace(title3,vbCr,"
") & " "
	strBody = strBody & "First Name" & " : " & " " & Replace(fname3,vbCr,"
") & " "
	strBody = strBody & "Last Name" & " : " & " " & Replace(lname3,vbCr,"
") & "
"
	strBody = strBody & "Mileage No" & " : " & " " & Replace(mileage3,vbCr,"
") & "
"
	strBody = strBody & "Title (4)" & " : " & " " & Replace(title4,vbCr,"
") & " "
	strBody = strBody & "First Name" & " : " & " " & Replace(fname4,vbCr,"
") & " "
	strBody = strBody & "Last Name" & " : " & " " & Replace(lname4,vbCr,"
") & "
"
	strBody = strBody & "Mileage No" & " : " & " " & Replace(mileage4,vbCr,"
") & "
"
	strBody = strBody & "Type of ticket" & " : " & " " & Replace(ticket_type,vbCr,"
") & "
"
	strBody = strBody & "Traveller or Student" & " : " & " " & Replace(ticket_visa,vbCr,"
") & "
"
	strBody = strBody & "Type of Airline" & " : " & " " & Replace(airline_type,vbCr,"
") & "
"	
	strBody = strBody & "Departure Date" & " : " & " " & Replace(departuredate,vbCr,"
") & "
"
	strBody = strBody & "Return Date" & " : " & " " & Replace(returndate,vbCr,"
") & "
"
	strBody = strBody & "City, Country" & " : " & " " & Replace(country,vbCr,"
") & "
"
	strBody = strBody & "Valid of Ticket" & " : " & " " & Replace(valid,vbCr,"
") & "
"
	strBody = strBody & "Remark" & " : " & " " & Replace(remark,vbCr,"
") & "
"
	
	strBody = strBody & ""
	
	Dim ObjSendMail
	Set ObjSendMail = Server.CreateObject("CDO.Message") 
     
	'This section provides the configuration information for the remote SMTP server.
     
	ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Send the message using the network (SMTP over the network).
	ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = smtpserver
	ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 
	ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False 'Use SSL for the connection (True or False)
	ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
     
	' If your server requires outgoing authentication uncomment the lines bleow and use a valid email address and password.
	ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication
	ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = youremail
	ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = yourpassword
     
	ObjSendMail.Configuration.Fields.Update
     
	'End remote SMTP server configuration section==
     
	ObjSendMail.To = youremail
	ObjSendMail.Subject = Booking_Subject
	ObjSendMail.From = Booking_Email
     
	' we are sending a html email.. simply switch the comments around to send a text email instead
	ObjSendMail.HTMLBody = strBody
	'ObjSendMail.TextBody = strBody
	
    objSendMail.Cc = "sandy@e-biz-travel.com"
	
 	ObjSendMail.Send
     
	Set ObjSendMail = Nothing 
	
' change the success messages below to say or do whatever you like
' you could do a response.redirect or offer a hyperlink somewhere.. etc etc
%>
  
 
  Your Reservation has been sent to us. 
  Thank You !!!
  for using E-Biz Travel Service We will get back to you shortly. 
  
  
     
      | e-Biz 
        Travel Co.,Ltd (Thailand) Central Reservation Office, 
        Bangkok operating hours :
 Monday - Friday 9:30 a.m. - 6:30 p.m., Saturday 
        9:30 a.m. - 2:30 p.m. (GMT+07:00)
 Office Close on Sunday & Thailand 
        Public Holidays
 Bangkok Office : 31 Phyathai 
        Building, 9th Floor, Room No. 916, Phyathai Road,
 Phyathai, Ratchthevi, Bangkok, Thailand 10400
 Tel : +66 2246-1400 to 2 Fax : +66 2246-1403
 | 
  
  
  
     
      |    We will respond to your request 
          promptly. Under normal circumstances you will hear from us within 24 
          hours and within 48 hours during weekend/holidays. However, sometimes 
          due to technical circumstances that are beyond our control and if you 
          do not hear from us, please send us a reminder with hotel subject to 
          contact@e-biz-travel.com . 
          We really appreciate this. You can count on our commitment to ensure 
          that your enquiry or reservation request is promptly attended to.
           
          At your services always ! | 
  
  
  <% Else %>
  
  <% End If %>
  
  
[ E-Biz-Travel.com 
  ]