 |
 |
|

|
<%
Function RegExpTest(sEmail)
RegExpTest = false
Dim regEx, retVal
Set regEx = New RegExp
' Create regular expression:
regEx.Pattern ="^[\w-\.]{1,}\@([\da-zA-Z-]{1,}\.){1,}[\da-zA-Z-]{2,3}$"
' Set pattern:
regEx.IgnoreCase = true
' Set case sensitivity.
retVal = regEx.Test(sEmail)
' Execute the search test.
If not retVal Then
exit function
End If
RegExpTest = true
End Function
If request.form("Submit")="Submit" then
'validate the form
strError = ""
For Each Field in Request.Form
'all fields required but company and comments
If Request.Form(Field) = "" then
strField = Field
If strField = "Comments" OR strField = "Company" then
'do nothing no error
else
strError = strError & "The following field is required: " & Field & " "
End If
End if
Next
If Not IsNumeric(request.Form("Phone")) then
strError = strError & "Phone numbers must be numeric "
End If
emailAddress = Cstr(request.form("Email"))
if emailAddress <> "" then
blnValidEmail = RegExpTest(emailAddress)
if Not blnValidEmail then
strError = strError & "The email entered is not a valid email address. "
end if
end if
If strError = "" then
'send the emails
bodystr="Results from Request Form"
bodystr=bodystr & "
Name: " & request("strName")
bodystr=bodystr & " Company: " & request("Company")
bodystr=bodystr & " Address1: " & request("Address1")
bodystr=bodystr & " City: " & request("City")
bodystr=bodystr & " State: " & request("State")
bodystr=bodystr & " Zip: " & request("Zip")
bodystr=bodystr &" Phone: " & request("Phone")
bodystr=bodystr & " Email: " & request("Email")
bodystr=bodystr & " Comments: " & request("Comments")
bodystr=bodystr & "
"
bodystr=bodystr & " The Daily Trade Blaster: " & request("TheDailyTradeBlaster")
bodystr=bodystr & "
"
bodystr=bodystr & " Hear About Us?: " & request("D1")
bodystr=bodystr & " Do You Currently Trade?: " & request("D2")
bodystr=bodystr & " Starter Kit?: " & request("D3")
' Create an instance of the NewMail object.
Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
' Set the properties of the objeect
' This syntax works fine
' But this gets you the appearance of a real name!
objCDOMail.From = request.form("Email")
objCDOMail.To = "info@slipkafutures.com"
'this line was for testing purposes
'objCDOMail.To = "pat@sullivan-street.com"
objCDOMail.Subject = "SF JIGSAW TRIAL"
objCDOMail.Body = bodystr
objCDOMail.BodyFormat = 0
' Outlook gives you grief unless you also set:
objCDOMail.MailFormat = 0 ' CdoMailFormatMime
' Send the message!
objCDOMail.Send
' Set the object to nothing because it immediately becomes
' invalid after calling the Send method.
Set objCDOMail = Nothing
bodystr="Dear " & request("strName") & ": "
bodystr=bodystr+"Thank you for your interest in The Daily Trade Blaster. You will receive your first issue soon.
"_
& "As an introducing commodity broker, our chosen focus is on the novice trader, where we specialize in serving the trading needs of those who follow"_
& " 1-2-3 chart patterns, sideways breakout channels, option trading programs, and seasonal strategies. We know these trading approaches thoroughly, and use that knowledge"_
& " to help our clients become more successful futures and options investors."_
& ""_
& " When you are ready to begin trading, please consider"_
& " Slipka Trading Group, Inc. as your broker. Kindest regards, David SlipkaPresident "_
& " info@slipkafutures.com 612-371-4994 800-753-3665 612-371-4956 fax "_
& " www.slipkafutures.com "
' Create an instance of the NewMail object.
Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
' Set the properties of the objeect
' This syntax works fine
' But this gets you the appearance of a real name!
objCDOMail.From = "info@slipkafutures.com"
objCDOMail.To = request.form("Email")
objCDOMail.Subject = "The Daily Trade Blaster"
objCDOMail.Body = bodystr
objCDOMail.BodyFormat = 0
' Outlook gives you grief unless you also set:
objCDOMail.MailFormat = 0 ' CdoMailFormatMime
' Send the message!
objCDOMail.Send
' Set the object to nothing because it immediately becomes
' invalid after calling the Send method.
Set objCDOMail = Nothing
response.redirect("submit_success.htm")
end If
%>
<%End if%>
|
|
|
 |
|
|