<% 'Dim variables Dim vTry, bValidForm Dim vName, vEmail, vSubject, vMessage,vtelephone Dim bName, bEmail, bSubject, bMessage,btelephone vTry = Request.QueryString("Try") bValidForm = False vName = "" Email = "" vSubject = "" vMessage = "" vtelephone="" btelephone="" vName = Request.Form("txtName") vEmail = Request.Form("txtEmail") vSubject = Request.Form("txtSubject") vMessage = Request.Form("txtMessage") vtelephone=Request.Form("txtTelephone") 'Check if E-mail adrress is valid. function isValidEmail(byval vEmail) ' very simple email validation function. returnVal = false if not isEmpty(vEmail) then if instr(vEmail, "@") > 0 and instr(vEmail, ".") > 0 then returnVal = true end if end if isValidEmail = returnVal end function 'Check if field is filled with data and if e-mail is correct if vName = "" then bName = false else bName = true end if if isValidEmail(vEmail) then bEmail = true else bEmail = false end if if vSubject = "" then bSubject = false else bSubject = true end if if vMessage = "" then bMessage = false else bMessage = true end if If bName and bEmail and bSubject and bMessage = True and vTry = "Second" or vTry = "Third" Then bValidForm = True Name = Request.Form("txtName") Email = Request.Form("txtEmail") Subject = Request.Form("txtSubject") Message = Request.Form("txtMessage") Telephone = Request.Form("txtTelephone") Set Mail = Server.CreateObject("Persits.MailSender") Mail.Host = "mail.fmsb.com.my" ' Specify a valid SMTP server Mail.From = Email ' Specify sender's address Mail.FromName = Name ' Specify sender's name Mail.Username = "admin@fmsb.com.my" Mail.Password = "ums66fbu" Mail.AddAddress "ttsoon@fmsb.com.my" Mail.AddReplyTo Email Mail.Subject = Subject newmessage = "The subject of my enquiry is : " & subject Mail.Body = newmessage & chr(10) & chr(13) & chr(13) & "My Telephone number is: " & TelePhone & chr(10) & chr(13) & chr(13) & Message On Error Resume Next Mail.Send If Err <> 0 Then Response.Write "Error encountered: " & Err.Description End If Response.Redirect "SendSucces.asp" Else bValidForm = False End If If vTry = "" Then vTry = "Second" Else vTry = "Third" End If If Request.QueryString("Try") = "Second" or Request.QueryString("Try") = "" Then %> newFeedbackForm.asp


FMSB Services Sdn Bhd
FMSB Taxation Services Sdn Bhd
Enquiries / Feedback

Please provide us with your contact telephone number for immediate response      on your enquiries/feedback.

<% if vTry = "Third" Then %> <% End If %>
Please fill in the red marked fields. Thank you!
<% if bName = False and vTry = "Third" Then response.write "" end if %> Your Name <% if bName = False and vTry = "Third" Then response.write "" end if %>
<% if bEmail = False and vTry = "Third" Then response.write "" end if %> Your E-mail <% if bEmail = False and vTry = "Third" Then response.write "" end if %>
Telephone/
Mobile
<% if bSubject = False and vTry = "Third" Then response.write "" end if %> Subject <% if bSubject = False and vTry = "Third" Then response.write "" end if %>
<% if bMessage = False and vTry = "Third" Then response.write "" end if %> Message <% if bMessage = False and vTry = "Third" Then response.write "" end if %>
 




 

<% Else If Request.QueryString ("Try") = "Third" Then response.redirect "WrongData.asp" End If End If %>