Tell a friend ver 1.1
Tell a friend
Original Author: Bhushan-
Code
Tell a Friend
So once he clicks on that hyperlink the URL is carried to mail.asp and let us see what mail.asp will do for us.
<%
URL = Request.QueryString("URL")
If Len(URL) = 0 Then URL = "http://www.planet-source-code.com" ' The default URL
name=request.form("Sendersname")
from=request.form("SendersEmail")
message=Request.Form("Message")
If Len(Request.Form("SendersEmail")) > 0 Then ' Time to send the emails
Dim objMail,FriendEmail,I
sBody = "This Page at " & URL & " has been recommended by " & name & " at " & Request.Form("SendersEmail") & vbCrLf & " <-- Message For You--> " & vbcrlf & message
I=0
' Loop until no more email addresses are given.
Do While True
FriendEmail = Request.Form("FriendEmail" & I)
If Len(FriendEmail) = 0 Then
Exit Do
Else
Set objMail = CreateObject("CDONTS.NewMail")
objMail.From = name
objMail.Subject = "Recommended Page"
objMail.Importance=1
objMail.Body = sBody
objMail.To = FriendEmail
objMail.Send()
End If
I=I+1
Loop
Set objMail = Nothing%>
<%
Response.write "Thank you for Recommending us to Your Friends.
"%>
<%
Response.write "Click here to return to " & URL & "
Else
%>