%@Language=VBScript %>
<% if Request.QueryString("isSubmitted") = "yes" then
'validate and then submit the form
Dim bglobalError
Dim FromtheEmail
Dim FromtheFirstName
Dim FromtheLastName
dim theMessageBody
Dim FromtheAddress
Dim FromtheCity
Dim FromtheState
bglobalError = 0
FromtheFirstName = Request.Form("FromFirstName")
FromtheLastName = Request.Form("FromLastName")
FromtheEmail = Request.Form("Fromemail")
FromtheAddress = Request.Form("FromAddress")
FromtheCity = Request.Form("FromCity")
FromtheState = Request.Form("FromState")
theMessageBody = Request.Form("theMessage")
if ValidateFromFirstName(FromtheFirstName) = False then
Dim ErrorFromFirstName
ErrorFromFirstName = "*Please enter a valid first name. "
bglobalError = bglobalError + 1 'increment to show there was an error
end if
'if ValidateToFirstName(TotheFirstName) = False then
'Dim ErrorToFirstName
'ErrorToFirstName = "*Please enter a valid first name. "
'bglobalError = bglobalError + 1 'increment to show there was an error
'end if
if ValidateFromEmail(FromtheEmail) = False then
Dim ErrorFromEmail
ErrorFromEmail = "*Please enter a valid email address. "
bglobalError = bglobalError + 1 'increment to show there was an error
end if
if ValidateMessage(theMessageBody) = False then
Dim ErrorTheMessage
ErrorTheMessage = "*Please enter something in the message field. "
bglobalError = bglobalError + 1 'increment to show there was an error
end if
'if ValidateToEmail(TotheEmail) = False then
'Dim ErrorToEmail
'ErrorToEmail = "*Please enter a valid email address. "
'bglobalError = bglobalError + 1 'increment to show there was an error
'end if
'validation functions
Function ValidateFromFirstName(Expression) 'tests the first name
Dim objRegExp
Set objRegExp = New RegExp
objRegExp.Pattern = "^[a-zA-Z]+$"
ValidateFromFirstName = objRegExp.Test(Expression)
End Function
'Function ValidateToFirstName(Expression) 'tests the last name
'Dim objRegExp
'Set objRegExp = New RegExp
'objRegExp.Pattern = "^[a-zA-Z]+$"
'ValidateToFirstName = objRegExp.Test(Expression)
'End Function
Function ValidateFromEmail(Expression) 'tests the email
Dim objRegExp
Set objRegExp = New RegExp
objRegExp.Pattern = "^[\w\.-]+@[\w\.-]+\.[a-zA-Z]+$"
ValidateFromEmail = objRegExp.Test(Expression)
End Function
Function ValidateMessage(Expression)
if Expression = "" then
ValidateMessage = False
Else
ValidateMessage = True
end if
End Function
'Function ValidateToEmail(Expression) 'tests the email
'Dim objRegExp
'Set objRegExp = New RegExp
'objRegExp.Pattern = "^[\w\.-]+@[\w\.-]+\.[a-zA-Z]+$"
'ValidateToEmail = objRegExp.Test(Expression)
'End Function
if bglobalError = 0 then 'if data is valid send the email
Dim EmailMessage
EmailMessage = "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" & Chr(13) & Chr(10) & _
"Message sent through your website" & Chr(13) & Chr(10) & _
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" & Chr(13) & Chr(10) & Chr(13) & Chr(10) & _
"From: " & FromtheFirstName & " " & FromtheLastName & Chr(13) & Chr(10) & _
"Address: " & FromtheAddress & ", " & FromtheCity & Chr(13) & Chr(10) & _
"State: " & FromtheState & Chr(13) & Chr(10) & _
"Email: " & FromtheEmail & Chr(13) & Chr(10) & _
"Message: " & theMessageBody
Set Mail = Server.CreateObject("Persits.MailSender")
Mail.Host = "mail.rjmillworksolutions.com" ' Specify a valid SMTP server
Mail.From = "2898-rjmsc@rjmillworksolutions.com" ' Specify sender's address
Mail.FromName = "RJ Millwork Solutions" ' Specify sender's name
Mail.AddAddress "mpelarcik@rjmillworksolutions.com"
Mail.Subject = "Website Message"
Mail.Body = EMailMessage
On Error Resume Next
Mail.SendToQueue
Set Mail = Nothing
If Err <> 0 Then
Response.Write "Error encountered: " & Err.Description
End If
end if
end if
%>
Contact us, we're your one stop custom millwork shop! Wood doors and more
Andrew's Workshop - dedicated to helping the
new woodworker enjoy the craft of woodworking with basic topics of interest to the
new wood artisan.
woodworking tools - Manufacturers and distributors of industrial quality
woodworking drills including twist drills, boring bits, countersinks, router bits, cutters and much more.
Legacy Stoneworks - Building Stone A NY stonework company offering affordable stonework services, stone veneer and building stone.
High quality granite stone veneer, stonecutting, raw quarried granite building stone and installation.