%
FullName = Request.Form("FullName")
Email = Request.Form("Email")
Phone = Request.Form("Phone")
Comments = Request.Form("Comments")
task = Request.Form("task")
error = Request("error")
message = Request("message")
If task="submit" then
If Len(FullName)<5 Then
message="- Your NAME is either missing or it is too short!" & "
"
error="Y"
End If
If ((Len(Email)<5) and (Len(Phone)<7)) Then
message=message & "- Please enter a valid E-mail address or Phone Number so we may contact you." & "
"
error="Y"
End If
If Len(Comments)<10 Then
message= message & "- Your COMMENTS are either missing or it is too short!" & "
"
error="Y"
End If
If Len(Comments)>1500 Then
message= message & "- Your COMMENTS have exceeded the maximum limit." & "
"
error="Y"
End If
End If
If error<>"Y" and task="submit" then
FullName = Request.Form("FullName")
Email = Request.Form("Email")
Phone = Request.Form("Phone")
Comments = Request.Form("Comments")
dt = now()
' *** DJA code addition - BEGIN
sch = "http://schemas.microsoft.com/cdo/configuration/"
Set cdoConfig = CreateObject("CDO.Configuration")
With cdoConfig.Fields
.Item(sch & "sendusing") = 2 ' cdoSendUsingPort
.Item(sch & "smtpserver") = "east.smtp.exch029.serverdata.net"
.update
End With
' *** DJA code addition - END
Set cdoMessage = CreateObject("CDO.Message")
With cdoMessage
' *** DJA code addition - BEGIN
Set .Configuration = cdoConfig
' *** DJA code addition - END
.From = "website@bethunelaw.com"
.To = "info@bethunelaw.com"
'.To = "DavidAUM@gmail.com"
'.To = "mdavis_az@cox.net"
.Subject = "**Bethunelaw.com Online Contact**"
.TextBody = "***Bethunelaw.com Online Contact***" & vbCrLf & _
"Date/Time: " & dt & vbCrLf & _
"" & vbCrLf & _
"Name: " & FullName & vbCrLf & _
"Email: " & Email & vbCrLf & _
"Phone: " & Phone & vbCrLf & _
"Comments: " & Comments
.Send
End With
Set cdoMessage = Nothing
Set cdoConfig = Nothing
response.redirect("contact_us_confirm.asp")
End If
%>
|