<%
' #### 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="www.destinationscotland.com has been recommended to you by a friend"
' Footer Messages sent with each email
EmailFooter1="This message was sent to you by a vistor to our site at:"
EmailFooter2="www.destinationscotland.com"
EmailFooter3="For great holiday and travel ideas."
' 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="webmaster@calinet.co.uk"
' Heading font color
FontColor="#5e007f"
' Heading Background Color
HeadColor="#ffc500"
' 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)
%>
<%
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 mailed!
It was sent to:
<%
Call Send
%>
Thank you for recommending us.
<%
Else
ShowFormField("Bert")
End If
%>
Sponsored Links: