Insert your friends email address and refer them to this site FrontPage Example



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:

Send it:::

How To:

This function will require two pages – referit.asp and referit2.asp.

Referit.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).

Referit2.asp:
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 = "webmaster@myweb.com" ' Specify sender's address Mail.FromName = Request("SenderName") ' Specify sender's name Mail.AddAddress Request("email") ' Name is optional Mail.AddReplyTo "webmaster@myweb.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) & _ "See ya!" On Error Resume Next Mail.Send If Err <> 0 Then
Response.Write “Error encountered: ” & Err.Description
End If
%>

To insert this code, switch to HTML view and then copy/paste the code into the body of the of the page (between the tags).

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.

Leave a Reply

Your email address will not be published. Required fields are marked *