Insert your friends email address and refer them to this site…
Go ahead! Insert your friends email address to tell them about this site.
Enter your name:
Your friends email:
This function will require two pages – referit.asp and referit2.asp.
1. Create the form above on a new blank page and save it as referit.asp.
2. Name the first box “SenderName”.
3. Name the second box “Email”.
4. Set the form action to referit2.asp (right click in the form, Form Properties, Send to other, Options, Action box).
On referit2.asp, we are going to use an ASP mail component (for more information on this particular component, see www.aspemail.com or contact your web host). Here is the code:
Set Mail = Server.CreateObject("Persits.MailSender")
Mail.Host = "smtp.myserver.com" ' Specify a valid SMTP server
Mail.From = "firstname.lastname@example.org" ' Specify sender's address
Mail.FromName = Request("SenderName") ' Specify sender's name
Mail.AddAddress Request("email") ' Name is optional
Mail.AddReplyTo "email@example.com"' 'Reply to Address
Mail.Subject = Request("SenderName") & " recommends this site!"
Mail.Body = "Hey, this is " & Request("SenderName") & "!" & Chr(10) & Chr(10) & _
"You have to check out this site:" & Chr(10) & Chr(10) & _
"http://www.FrontPageHowTo.com" & Chr(10) & Chr(10) & _
On Error Resume Next
If Err <> 0 Then
Response.Write “Error encountered: ” & Err.Description
To insert this code, switch to HTML view and then copy/paste the code into the body of the of the page (between thetags).
Note: You will want to first paste this code into Notepad and then copy paste it from there into your page.
Note 2: Make sure you check with your web host to find out what if any mail components that have installed on your web server. If they have none, then you might request that they install one. The above code will only work with the aspemail component available from www.aspemail.com. There are several commercially available mail components and each has it’s own requirements. Luckily, the web sites for these components usually give complete code samples for you to use.