<%
dim emailAddress, option1, option2
emailAddress = Request.Form("requestorEmail")
option1 = cstr(Request.Form("item1"))
option2 = cstr(Request.Form("item2"))
if emailAddress<>"" then
emailAddress = Cstr(emailAddress)
blnValidEmail = RegExpTest(emailAddress)
if blnValidEmail then
if option1="" and option2 = "" then
Response.Write("
No item has been selected. Please try again.")
else
' Response.Write("
Thanks for your request, the items are now being sent to " & emailAddress & "")
EmailItems
Response.Redirect "resources_sent.asp"
end if
else
Response.Write("
'" & emailAddress & "' is not a recognized email address format, please try again.")
end if
end if
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
Sub EMailItems
Set TheMessage=CreateObject("CDO.Message")
TheMessage.Subject="Pepperdog Resources Requested"
TheMessage.From="pepperdog@pepperdog.net"
TheMessage.ReplyTo="info@pepperdog.net"
TheMessage.To=emailAddress
TheMessage.HTMLBody = "
Dear " & emailAddress & "
Thank you for your interest in Pepperdog Video Analytics.
The items you requested through our website have been attached to this email in PDF format.
If you have any further questions, please don't hesitate to contact me by replying to this email or by calling the office number given below.
Simon Parker
Pepperdog Video Analytics Limited
+44 (0) 1189 736811
www.pepperdog.net
"
TheMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
TheMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="mail.pepperdog.net"
TheMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") =25
TheMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
TheMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusername") = "pepperdog@pepperdog.net"
TheMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "7billw"
TheMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False
TheMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
TheMessage.Configuration.Fields.Update
if option1 <> "" then
' Response.Write(Server.MapPath(Request.ServerVariables("PATH_INFO")))
TheMessage.AddAttachment Server.MapPath("pdf") & "\" & option1
end if
if option2 <> "" then
TheMessage.AddAttachment Server.MapPath("pdf") & "\" & option2
end if
TheMessage.Send
set TheMessage=nothing
Set TheMessage=CreateObject("CDO.Message")
TheMessage.Subject="Pepperdog Resources Requested"
TheMessage.From="pepperdog@pepperdog.net"
TheMessage.To="info@pepperdog.net"
TheMessage.HTMLBody = "
Name: " & Request.Form("requestorName") & "
Position: " & Request.Form("requestorPosition") & "
Organization: " & Request.Form("requestorCompany") & "
Email: " & Request.Form("requestorEmail") & "
Requested: " & option1 & " " & option2
TheMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
TheMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="mail.pepperdog.net"
TheMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
TheMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
TheMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusername") = "pepperdog@pepperdog.net"
TheMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "7billw"
TheMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False
TheMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
TheMessage.Configuration.Fields.Update
TheMessage.Send
set TheMessage=nothing
End Sub
%>