PDA

View Full Version : Tell a Friend


twalter
09-30-2003, 12:16 AM
Here is a bit of code I posted on www.aspin.com
Has a 4 and 1/2 star rating

http://www.aspin.com/func/content-search?id=4216310&qry=email+a+friend

--------------- tell a friend email script------------

<%

dim done
done = request.form("done")
if done = "" then
done = "No"
%>
<html>
<head>
<title>Tell a friend</title>
</head>
<body>
<table border="1" cellspacing="0" cellpadding="0" bgcolor="#006599">
<TR>
<TD>
<form action="tellfriend.asp" method="post">
<B><font color="white">Tell a Friend</font><B>:<BR>
<input type="text" name="email" size="20" maxlength="50"><BR>
<input type="hidden" name="done" value="Yes">
<center><input type="submit" name="submit" value="Tell a friend"></center>
</form>
</TD>
</TR>
</Table>
</body>
</html>
<%
Else
if request.form("done") = "Yes" then

'sets variables
dim email, sendmail
email = request.form("email")

Set sendmail = Server.CreateObject("CDONTS.NewMail")

'put the webmaster address here
sendmail.From = "webmaster@aspbasics.com"

'The mail is sent to the address entered in the previous page.
sendmail.To = email

'Enter the subject of your mail here
sendmail.Subject = "Check out this website"

'send a specific page or send a site url
dim url
'url = Request.ServerVariables("HTTP_REFERER")
url = "http://www.aspbasics.net"

'This is the content of thr message.
sendmail.Body = "Site recommendation from a friend!" & _
vbCrlf & vbCrlf & "A friend has sent you this email and thought you would should check out this site." & _
vbCrlf & url & vbCrlf

'this sets mail priority.... 0=low 1=normal 2=high
sendmail.Importance = 1
sendmail.Send 'Send the email!

response.redirect Request.ServerVariables("HTTP_REFERER")
'Response.write ("Sent to ") & email

End if
End if
%>