<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% if (Request.Form("Submit")="Send") then if Request.Form("form_contactname")="" then errmsg="
  • Contact Name is Blank" if Request.Form("form_phone")="" then errmsg=errmsg&"
  • Phone Number is Blank" if Request.Form("form_email")="" then errmsg=errmsg&"
  • Email field is Blank." else if Request.Form("form_email")<>"" then Dim regEx, retVal Set regEx = New RegExp regEx.Pattern ="^[\w-\.]{1,}\@([\da-zA-Z-]{1,}\.){1,}[\da-zA-Z-]{2,3}$" regEx.IgnoreCase = true retVal = regEx.Test(Request.Form("form_email")) If not retVal Then errmsg=errmsg&"
  • Invalid Email address." End If end if end if if errmsg="" then MemEmail=Request.Form("form_email") Contactname=Request.Form("form_contactname") Phonenumber=Request.Form("form_phone") cmt=Request.Form("form_cmt") Message=Request.Form("form_requestmessage") NewPageLocation=Request.Form("redirect_location") IP = Request.ServerVariables("HTTP_X_FORWARDED_FOR") If IP = "" Then IP = Request.ServerVariables("REMOTE_ADDR") referrer = Request.ServerVariables("HTTP_REFERER") 'Create the e-mail server object Set objCDOSYSMail = Server.CreateObject("CDO.Message") Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration") 'Out going SMTP server objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="mail.swanmarina.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 'Update the CDOSYS Configuration Set objCDOSYSMail.Configuration = objCDOSYSCon objCDOSYSMail.From = "info@swanmarina.com"' the address you want the email to be from objCDOSYSMail.TO ="jborieo@swanmarina.com"'the address the mail is to be sent to objCDOSYSMail.Subject = "Contact Form" objCDOSYSMail.HTMLBody = "Contact Message From:"&Contactname&"

    Phone Number:"&Phonenumber&"

    Message:"&cmt&"

    IP:"&IP&"

    Referrer:"&Referrer&"
    " objCDOSYSMail.Send 'Close the server mail object Set objCDOSYSMail = Nothing Set objCDOSYSCon = Nothing Response.Redirect(NewPageLocation) end if end if %> Contact Us <% if errmsg <> "" then %> <% Response.Write("Following Errors Occurred"&errmsg) %>

    <% end if %>
    Full Name: " type="text" name="form_contactname" maxlength="60">
    Email: " type="text" name="form_email" maxlength="60">
    Phone: " type="text" name="form_phone" maxlength="60">
    Message: