%@ Language=VBScript %>
<%
strPost = Trim(Request.QueryString("post"))
If strPost = "1" Then
function sendmail(too, from, subject, body)
dim objCDOSYSMail
Dim objCDOSYSCon
Set objCDOSYSMail = Server.CreateObject("CDO.Message")
Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.equilox.com"
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
objCDOSYSCon.Fields.Update
Set objCDOSYSMail.Configuration = objCDOSYSCon
objCDOSYSMail.From = from
objCDOSYSMail.To= too
objCDOSYSMail.Subject = subject
'use one or the other but not both
'objCDOSYSMail.HTMLBody = body
objCDOSYSMail.TextBody = body
objCDOSYSMail.Send
If Err.Number <> 0 Then
strFSend = "error"
strErrortext = Err.Description & " We're sorry, an unexpected error accrued while trying to complete your request! Please try again."
else
Response.Redirect "testimonialsThankYou.html"
end if
set objCDOSYSMail = Nothing
end function
'================================================
'Send mail
'================================================
Dim strYourName, strYourEmail, strYourLocation, strYourComments
strYourName = Trim(Request.Form("name"))
strYourEmail = Trim(Request.Form("email"))
strYourLocation = Trim(Request.Form("location"))
strYourComments = Trim(Request.Form("comments"))
'===============================================
'Server side verification
'===============================================
If strYourName = "" Then
strErrortext = "Please enter your name!
"
strFSend = "error"
End If
If strYourEmail = "" Then
strErrortext = strErrortext & "Please enter your e-mail!
"
strFSend = "error"
elseif inStr(strYourEmail,"@") = 0 OR inStr(strYourEmail,".") = 0 Then
strErrortext = strErrortext & "Please enter a valid e-mail!
"
strFSend = "error"
End If
If strYourComments = "" Then
strErrortext = strErrortext & "Please enter your comments!"
strFSend = "error"
elseif len(strYourComments) > 800 then
strErrortext = strErrortext & "Comments can't be more than 800!"
strFSend = "error"
End If
'================================================
'Format and send email
'================================================
If strFSend <> "error" Then
Dim too, from, subject, body
too = "info@equilox.com"
subject = "Equilox.com Testimonials E-mail Form"
from = "info@equilox.com"
'================================================
'Concatinate rest of variables into body
'================================================
body = "Name: " & strYourName & vbNewLine & vbNewLine &_
"E-mail: " & strYourEmail & vbNewLine & vbNewLine &_
"Location: " & strYourLocation & vbNewLine & vbNewLine &_
"Comments: " & vbNewLine &_
strYourComments & vbNewLine & vbNewLine &_
" --- End Message ---" & vbNewLine & vbNewLine_
body = body
'================================================
'Call sendmail function
'================================================
Dim passTest
passTest = sendmail(too, from, subject, body)
End if
end if
%>