how do i create send a link to friend function

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can i create the function that enables someone to click a button in my
web site that can then send a link to there friends or family that links them
to my site eg (click here to send a link to friend)
 
Very simply, copy the code below as it is, into your code on your page.
Save the page and do a Preview or Preview in Browser, then click the link.

<a href="mailto:Type Email Here&subject="Hey Look at this
link!&body="www.theurlhere.com">Click Here to Send to a Friend</a>

The link is a normal href mailto plus a subject & body parameters added.

Clicking the link will open your email program will have filled in the
following fields in the message window:

To: Type Email here

Subject : Hey Look at this link!

and in the body:

www.theurlhere.com

All you need to do is choose the "To" email addresses and send the message.

You can change the "&subject=" bit to what you want as your subject, and
change the "&body=" bit to suit you.
The &body= might have a limit on how long it can be, but generally all you'd
what is the link to your site, and a short description if nothing else.
Since it is calling up the email program, it is going to show it being a
message from whoever is viewing your site, so not considered spam or
anything like that.

There are other scripting ways to do this, but the above is the simplest
without any need for server side or client side scriptig.
 
Andrew said:
Very simply, copy the code below as it is, into your code on your
page. Save the page and do a Preview or Preview in Browser, then
click the link.
<a href="mailto:Type Email Here&subject="Hey Look at this
link!&body="www.theurlhere.com">Click Here to Send to a Friend</a>

The link is a normal href mailto plus a subject & body parameters
added.
Clicking the link will open your email program will have filled in the
following fields in the message window:

To: Type Email here

Subject : Hey Look at this link!

and in the body:

www.theurlhere.com

All you need to do is choose the "To" email addresses and send the
message.
You can change the "&subject=" bit to what you want as your subject,
and change the "&body=" bit to suit you.
The &body= might have a limit on how long it can be, but generally
all you'd what is the link to your site, and a short description if
nothing else. Since it is calling up the email program, it is going
to show it being a message from whoever is viewing your site, so not
considered spam or anything like that.

There are other scripting ways to do this, but the above is the
simplest without any need for server side or client side scriptig.

Andrew,
Great thinking.

Much simpler than the script I posted (although mine did add another
function to check for valid Email addresses, which may be unnecessary)

However, one small point.
The first parameter should be prefixed by '?' not '&'

And there should be a few less quotes.

So it should read (tested):
<a href="mailto:Type Email Here?subject=Hey Look at this
link!&body=www.theurlhere.com">Click Here to Send to a Friend</a>
 
Back
Top