A quick and easy way to create an “email this page” link for someone?

Is there a quick way to create a link that, when clicked, will allow the user to send a link to the page on which they are located, via mailto?

+5
source share
2 answers

To send a link to the page that you are using, try the following code:

<a HREF="mailto:?subject=look at this website&body=Hi,I found this website
and thought you might like it <?php
$url="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
echo $url;
?>">Tell a friend!</a>

php will get the url of the page you're currently on.

+6
source

Why not use the mailto HTML link?

<a href="mailto:?Subject=A%20page%20I%20found%20interesting&body=url_of_your_page">
    Mail this page to a friend
</a>

Remember to tell urlencode your theme / body content, like urlencode in PHP.

+3
source