First, place this link on your home page:
Email This Page
Next, create a page in your root directory called emailthispage.asp and paste the following code:
Last, create a confirmation page called emailthispageconfirm.asp, paste the following code, and customize it with your own domain name and mailing info:
<%
DIM Mailer, strEmail, strMsgHeader, qryItem, strMsgInfo
DIM strYourEmail, strYourName, strRecipEmail, strRecipName, strComments, strURL, Mail
strYourEmail = Request.Form("YourEmail")
strYourName = Request.Form("YourName")
strRecipEmail = Request.Form("RecipEmail")
strRecipName = Request.Form("RecipName")
strComments = Request.Form("Comments")
strURL = Request.Form("URL")
Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.FromAddress = strYourEmail
Mailer.ReplyTo = strYourEmail
Mailer.RemoteHost = "YOUR_DOMAIN_NAME.COM"
Mailer.AddRecipient strRecipName, strRecipEmail
Mailer.Subject = "Look at this page from the YOUR_WEBSITE_NAME_HERE website"
strMsgHeader = "This mail message was sent from the YOUR_DOMAIN_NAME_HERE website" & vbCrLf & vbCrLf
Mailer.BodyText = strMsgHeader & vbCrLf & strRecipName & "," & vbCrLf & vbCrLf & strYourName & " wants you to take a look at this page at YOUR_WEBSITE_NAME_HERE:" & vbCrLf & "Page Link: " & strURL & vbCrLf & vbCrLf & strComments
IF Mailer.SendMail THEN
%>
<%
strYourName = request.form("YourName")
Response.Write strYourName
%>
,
Thank you for sharing this page with
<%
strRecipName = request.form("RecipName")
Response.Write strRecipName
%>
. Your message has been sent successfully and will be received by
<%
strRecipName = request.form("RecipName")
Response.Write strRecipName
%>
shortly.
ELSE
Response.Write "Sorry, there was an error and your email could not be sent at this time."
END IF
%>
That's all there is to it. The confirmation page is even customized so that it displays the sender's and recipient's names. Now, anytime one of your website users sees something interesting, they can email that page link to any email address they want. In essence, it helps drive more traffic to your website!
http://www.aspwebpro.com/aspscripts/websitetools/emailthispage.asp
No comments:
Post a Comment