Tell A Friend code that is used on ASPFree.com

Contributed by
Rating: 4 stars4 stars4 stars4 stars4 stars / 20
January 05, 2001
Rate this Article:
MEH MEH++


SEARCH ASP FREE
TOOLS YOU CAN USE

advertisement

We've had several people request the use of our Tell-A-Friend code.  Here you go!

Here is the code.

<% @language="vbscript" %>
<% Sub Thanks() %>

<html>
<head>
<title>Thanks for referring ASPFree.com</title>
</head>
<body>

<h2 align="center">Your Friends at ASPFree.com thank you recommending our website!</h2>
<br>
<br>

</body>
</html>

<% End Sub %>

<% Sub IntroPage() %>

<html>
<head>
<title>Tell-A-Friend Script</title>
</head>
<body>

<form method="POST" action="tellfriend.asp" name="form1">
<h2 align="center">Tell your friends about ASPFree.com!</h2></center>

<center>
<br>
<br>
<table border="0" width="50%">
    <tr>
        <td width="38%"><b>Friends Email Address:</b></td>
        <td width="62%"><input type="text" name="FriendsEmailAddress" size="40"></td>
    </tr>
    <tr>
        <td colspan="2" width="100%"><center><i>Their email address, e.g. username@domain.com</i></center></td></tr> 
    <tr>
        <td width="38%"><b>Your Email Address</b></td>
        <td width="62%"><input type="text" name="YourEmailAddress" size="40"></td>
    </tr>
    <tr>
        <td align="center" colspan="2" width="100%"><center><i>Your email address, e.g. username@domain.com</i></td>
    </tr> 
    <tr>
        <td width="38%"><b>Subject</b></td>
        <td width="62%"><input type="text" name="Subject" size="40" value="Check out this page @ ASPFree.com"></td>
    </tr>
    <tr>
        <td width="38%"><b>Comments</b></td>
        <td width="62%">&nbsp;</td>
    </tr>
    <tr>
        <td colspan="2" width="100%"><textarea rows="6" name="comments" cols="58">I recommend you check out this page : <% =         request("http_referer") %>
at http://www.ASPFree.com.

For ASPFree's forums-Quick, Easy to use, Searchable, Email when replyed to and more!!:
http://www.aspfree.com/forum/forums.aspx
</textarea> </td>
</tr>
</table>

<br>
<input type="submit" value="Send the Info!" name="btnSubmit"></center>
<br>
<br>
<blockquote>

This message sent to you from an associate as a service of ASPFree.com. For <br>
live ASP demos, downloads, source code, forums and more! 
<a href="http://www.aspfree.com/Default.asp">http://www.aspfree.com</a><br><br>
<i>When the message is sent, you'll automatically be copied on the message. <br>
The text immediately above will be added to the message automatically,<br>
identifying the message as coming from ASPfree.com.</i><br>

</blockquote>

</form>
</body>
</html>

<% End Sub %>

<% Sub DoRecords() %>
<%
'Write to a database if so desired
'dim strconn
'dim conn
'dim rs

'set conn = server.createobject("adodb.connection")
'conn.open strconn
'set rs = server.createobject("adodb.recordset")
'rs.open "PutYourTableNameHere", conn, 3, 3
'rs.addnew
'rs("name") = request("name")
'rs("emailaddress") = request("emailaddress")
'rs("phonenumber") = request("phonenumber")
'rs("comments") = request("comments")
'rs("DateSubmitted") = date()
'rs.update
'rs.close
'set rs = nothing
'conn.close
'set conn = nothing

strBody = "Your Friend has recommended you check out ASPFree.com: " & request("YourEmailaddress") & chr(10) & chr(10)
strBody = strBody & "Friends Comments: " & chr(10) & request("comments") & chr(10) & chr(10) & chr(10)
strBody = strBody & "This message sent to you from an associate as a service of ASPFree.com." 
strBody = strBody & "For live ASP+, ASP demos, downloads, source code, forums and more!&nbsp; http://www.aspfree.com" 

'Send a copy via an email
set objNewMail = server.CreateObject("CDONTS.NewMail")
objNewMail.From = request("YourEmailAddress")
objNewMail.To = request("FriendsEmailAddress")
objNewMail.CC = request("YourEmailAddress")
objNewMail.BCC = "webmaster@somedomain.com"
objNewMail.Subject = request("Subject")
objNewMail.Body = strBody
objNewMail.Send
set objNewMail = Nothing
response.redirect "tellfriend.asp?strMessage=Thanks"

End Sub
%>

<% 
If request("btnSubmit") = "" and request("strMessage") = "" Then
    call IntroPage()
End If

If request("btnSubmit") = "Send the Info!" Then
    call DoRecords()
End If

if request("strMessage") <> "" Then
    call Thanks()
End If
%>
blog comments powered by Disqus
DATABASE CODE ARTICLES

- Deployment of the MobiLink Synchronization M...
- MobiLink Synchronization Wizard in SQL Anywh...
- Finding Matching Records in Data Access Pages
- Using the AccessDataSource Control in VS 2005
- A Closer Look at ADO.NET: The Command Object
- A Closer Look at ADO.NET: The Connection Obj...
- Using ADO to Communicate with the Database, ...
- Code Snippets: Counting Records
- Constraints In Microsoft SQL Server 2000
- Multilingual entries into a DB and to be dis...
- Two combos, one textbox example
- ADO Recordset Paging
- SQL Server Database Creator - .NET Version
- Getting A List of Tables From SQL Server
- Discussion & Listserv Module by Mike Eck...

ASP Web Hosting ASP.Net Web Hosting Windows Web Hosting
 
 
 

ASP Free Forums 
 RSS  Tutorials RSS
 RSS  Forums RSS
 RSS  All Feeds
Site Map 
Request Media Kit
Write For Us Get Paid 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Privacy Policy 
Support 


© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 11 - Follow our Sitemap
Most Popular Topics
All ASP.Net Tutorials