<% ' #### This script Copyright (c) 2001 ASPjar.com, All Rights Reserved. NO WARRANTEE. ' #### You need CDONTS installed to be able to send mail ' #### Your sites information starts here #### ' Email Subject EmailSubject="Check out this website!!" ' Footer Messages sent with each email EmailFooter1="This message was sent to you by a vistor to our site at:" EmailFooter2="http://thundercloud.net/" EmailFooter3="This is a great site for free email stationery, screen savers, wallpaper, and other great stuff. It's all free too!" ' Do you also want to recieve all emails? YES or NO WebmasterMail="YES" ' Your Email Address - must be a valid domain or the mail will not send sYourEmail="cloud@thundercloud.net" ' Heading font color FontColor="#000080" ' Heading Background Color HeadColor="skyblue" ' Form Font Color FormFontColor="#ffc500" ' Form Background Color FormBackColor="#5e007f" 'Error Message Color ErrorColor="red" ' That's it! - you may now wish to customize the header and footer files to suit your site. ' #################################################################################### Function ValidateField(sFieldValue, sFieldType) Dim bFieldIsOkay, Email, Friend, Message bFieldIsOkay = true Select Case LCase(sFieldType) Case "uemail" If Len(sFieldValue) < 5 Then bFieldIsOkay = False Else If InStr(1, sFieldValue, "@", 1) < 2 Then bFieldIsOkay = False Else If InStr(1, sFieldValue, ".", 1) < 4 Then bFieldIsOkay = False End If End If End If Case "name" If Len(sFieldValue) = 0 Then bFieldIsOkay = False Case "fname" If Len(sFieldValue) = 0 Then bFieldIsOkay = False Case "email" If Len(sFieldValue) < 5 Then bFieldIsOkay = False Else If InStr(1, sFieldValue, "@", 1) < 2 Then bFieldIsOkay = False Else If InStr(1, sFieldValue, ".", 1) < 4 Then bFieldIsOkay = False End If End If End If Case "message" If Len(sFieldValue) = 0 Then bFieldIsOkay = False Case "else" bFieldIsOkay = False End Select ValidateField = bFieldIsOkay End Function Sub ShowFormField(Bert) %>
" METHOD="post">
Your name: 
" size="40" style="FONT-SIZE: 10px; COLOR: <%=FormFontColor%>; FONT-FAMILY: verdana, helvetica, arial; BACKGROUND-COLOR: <%=FormBackColor%>">
<% If dictFields(LCase("name")) Then Response.Write "You need to enter your name" Else Response.Write " " End If %>
Your email address: 
" size="40" style="FONT-SIZE: 10px; COLOR: <%=FormFontColor%>; FONT-FAMILY: verdana, helvetica, arial; BACKGROUND-COLOR: <%=FormBackColor%>">
<% If dictFields(LCase("uemail")) Then Response.Write "You need to enter a valid email address" Else Response.Write " " End If %>
Your friends name: 
" size="40" style="FONT-SIZE: 10px; COLOR: <%=FormFontColor%>; FONT-FAMILY: verdana, helvetica, arial; BACKGROUND-COLOR: <%=FormBackColor%>">
<% If dictFields(LCase("fname")) Then Response.Write "You need to enter your friends name" Else Response.Write " " End If %>
Your friends email address: 
" size="40" style="FONT-SIZE: 10px; COLOR: <%=FormFontColor%>; FONT-FAMILY: verdana, helvetica, arial; BACKGROUND-COLOR: <%=FormBackColor%>">
<% If dictFields(LCase("email")) Then Response.Write "You need to enter a valid email address" Else Response.Write " " End If %>
Your message: 
<% If dictFields(LCase("message")) Then Response.Write " You need to enter a message" Else Response.Write " " End If %>

<% End Sub Sub Send sPunterFriend = Request.Form("name") sPunterEmail = Request.Form("uemail") fName = Request.Form("fname") femail= Request.Form("email") Message = Request.Form("message") sSubject = "Check out all this Free Stuff" sMessage = "Dear " & fName & vbcrlf _ & "We received a message from your friend " & sPunterFriend & " ( " & sPunterEmail & " ) which said:" & vbcrlf _ & vbcrlf _ & Message & vbcrlf _ & vbcrlf _ & "_____________________________________________ " & vbcrlf _ & EmailFooter1 & vbcrlf _ & EmailFooter2 & vbcrlf _ & EmailFooter3 & vbcrlf Set objNewMail = CreateObject("CDONTS.NewMail") objNewMail.Send sPunterEmail, femail, EmailSubject, sMessage Set objNewMail = Nothing If WebmasterMail="YES" then Set objNewMail = CreateObject("CDONTS.NewMail") objNewMail.Send sPunterEmail, sYourEmail, EmailSubject, sMessage Set objNewMail = Nothing End IF Response.Write sPunterEmail End Sub Dim Field Dim dictFields Set dictFields = Server.CreateObject("Scripting.Dictionary") For Each Field in Request.Form If ValidateField(Request.Form(Field), Field) = False Then dictFields.Add LCase(Field), true End If Next If Request.Form.Count <> 0 And dictFields.Count = 0 Then %>

Your message has been sent!!
It was sent to:

<% Call Send %>

Thank you for recommending us.
<% Else ShowFormField("Bert") End If %>