Agency Program Registration
<%
Dim strTo, strSubject, strBody 'Strings for recipient, subject, body
Dim objCDOMail 'The CDO object
Errors = ""
'First we'll read in the values entered
nameto = Request.Form("nameto")
sendto = Request.Form("sendto")
namefrom = Request.Form("namefrom")
sendfrom = Request.Form("sendfrom")
message = Request.Form("message")
' Check for errors
if nameto = "" then
Errors = "Please enter the name of the person you are sending this to."
elseif (sendto = "") or (Not IsValidEmail(sendto)) then
Errors = "Please enter the e-mail address of the person you are sending this to."
elseif namefrom = "" then
Errors = "Please enter your name."
elseif (sendfrom = "") or (Not IsValidEmail(sendfrom)) then
Errors = "Please enter your e-mail address."
end if
if Errors <> "" then
%>
Thank you for referring us! Just fill in the form below to recommend this Agency Program
to a friend:
<%
If (Errors <> "" and request.form("submit") <> "") Then
%>
<%= Errors %>
<%
end if
%>
<%
Else
strSubject = "Design Wonders Networking Agency Program Referral"
strBody = "Your friend, " & namefrom & ", thought you might be interested in the Design Wonders Networking Agency Program! Follow the link below for more information on our Agency Program that could be making YOU money!" & vbCrLf & vbCrLf
strBody = strBody & "http://www.designwonders.com/agency.html" & vbCrLf & vbCrLf
if message <> " " then
strBody = strBody & "Below is a message from " & namefrom & ":" & vbCrLf & vbCrLf
strBody = strBody & message & vbCrLf & vbCrLf
end if
strBody = strBody & "For more information you can contact Design Wonders Networking at info@designwonders.com or 972-492-0444." & vbCrLf & vbCrLf
strBody = strBody & vbCrLf
DateTime = Now()
DisplayMonth = month(DateTime)
DisplayDay = day(DateTime)
DisplayYear = year(DateTime)
DisplayHour = Hour(DateTime)-1
DisplayMinute = minute(DateTime)
DisplayDate = DisplayMonth & "/" & DisplayDay & "/" & DisplayYear & " " & DisplayHour & ":" & DisplayMinute
Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
objCDOMail.From = "" & namefrom & " <" & sendfrom & ">"
objCDOMail.To = "" & nameto & " <" & sendto & ">"
objCDOMail.Subject = strSubject
objCDOMail.Body = strBody
objCDOMail.MailFormat = 0 ' CdoMailFormatMime
objCDOMail.Send
Set objCDOMail = Nothing
strBody2 = "Thank you for referring the Design Wonders Networking Agency Program to your friend, " & nameto & "! We appreciate your help!" & vbCrLf & vbCrLf
strBody2 = strBody2 & "Below is a copy of the e-mail that was sent to " & nameto & " (" & sendto & "):" & vbCrLf & vbCrLf
strBody2 = strBody2 & strBody & vbCrLf
Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
objCDOMail.From = "Design Wonders Networking "
objCDOMail.To = "" & namefrom & " <" & sendfrom & ">"
objCDOMail.Subject = strSubject
objCDOMail.Body = strBody2
objCDOMail.MailFormat = 0 ' CdoMailFormatMime
objCDOMail.Send
Set objCDOMail = Nothing
Response.Write "Thank you for referring the Design Wonders Networking Agency Program to your friend, " & nameto & "! We appreciate your help! "
response.write "Back to Design Wonders Networking home page. "
End If
Function IsValidEmail(strEmail)
Dim bIsValid
bIsValid = True
If Len(strEmail) < 5 Then
bIsValid = False
Else
If Instr(1, strEmail, " ") <> 0 Then
bIsValid = False
Else
If InStr(1, strEmail, "@", 1) < 2 Then
bIsValid = False
Else
If InStrRev(strEmail, ".") < InStr(1, strEmail, "@", 1) + 2 Then
bIsValid = False
End If
End If
End If
End If
IsValidEmail = bIsValid
End Function
%>
|