Send a Friend - Sending the Message

Send a Friend - Sending the Message
You've set up a button to encourage your visitors to Send a Friend a URL, and you've gathered the info from them. Now it's time to send the message.

The final step is in essence mostly a mailing script. If you haven't done ASP mailing scripts before, read my Sending Mail with ASP article.

Again, ignore the **********s :)

****************************

<%
ToEmail = Request.Form("receiver")
RecEmail = Request.Form("sender")
Comment = Request.Form("comment")

URL = Request.Form("url")

Subject = RecEmail & " would like you to look at this!"

Body = "A friend of yours, " & RecEmail & ", thought you'd enjoy reading an interesting article " & vbCrLf & _
"at https://www.XXXXXXXXX.com" & vbCrLf & vbCrLf & _
"Article URL: " & URL & vbCrLf & vbCrLf & _
"Your friend's comments: " & vbCrLf & _
Comment & vbCrLf & vbCrLf & _
"Visit this article and many other interesting articles at:" & vbCrLf & _
"https://www.XXXXXXXXXX.com"
Impt = 2
FromEmail = RecEmail

Dim objMail
set objMail = CreateObject("CDONTS.NewMail")
objMail.Send FromEmail,ToEmail,Subject,Body,Impt
set objMail = Nothing

Response.Redirect("emailthanks.asp?url=" & URL)
%>

*****************************

OK, the script takes in the URL and other info you gathered up, and sends a mail message out. Be sure to change the XXXXXXXXXs to your own website name of course! When it's done, it goes off to emailthanks.asp. You can have that page be just a regular generic 'thank you for emailing someone' page, and because the URL is passed in, you can have a link that says 'return to the URL you just came from' very easily.

Introduction to ASP Ebook

Download this ebook to get everything you need to know about learning ASP - from a step by step tutorial to function lists, sample code, common errors and solutions, and much more! 101 pages.




RSS
Related Articles
Editor's Picks Articles
Top Ten Articles
Previous Features
Site Map





Content copyright © 2023 by Lisa Shea. All rights reserved.
This content was written by Lisa Shea. If you wish to use this content in any manner, you need written permission. Contact Lisa Shea for details.