Post Pic

How to: Allow your visitors to send your articles by email to their friends

Many websites allow their visitors to send their articles to friends, so why not implement it on your WordPress blog? The following recipe contain an easy solution to do it.

To achieve this recipe, simply open your single.php template and paste the following code within the loop, where you want the "Email this" link to be displayed:

<a href="mailto:?subject=<?php the_title();
?>&amp;body=<?php the_permalink() ?>" title="Send this
article to a friend!">Email this</a>

That's all. Please note that it will only allow visitors using a mail software as such as Thunderbird or Outlook to email their friends.

This article has been submitted by chonchon. Have a good WordPress recipe that you'd like to share with the community? Contribute to WpRecipes!

21 Responses

Mar 27 2009 20:07

It’s an useful recipe also for gmailers. Thanks

Mar 27 2009 22:04

I think people like to retweet stuff nowadays.

Mar 28 2009 02:52

I assume there is no way to do this without those email programs?

Mar 28 2009 19:24

It is possible to do this straight from the site – with the user never having to get to their email client. However, it can be pretty involved (compared to this at least), and there are definitely some security precautions you want to get right (because you don’t want people sending spam from your comment form), so it’s usually best to leave it to a plugin. There are a number of them out there that do it.

Mar 29 2009 23:29

Very useful tip. Some people overlook this option as addon, as they think people don’t use it. But in contrary, people use this option very much.

Apr 01 2009 13:57

Can you please post the code for giving ability to link to the post page?
Just to make linking to your content simpler. Like:

Link to me:
Wp recipes
Can it be done with wordpress without much programming?

Apr 02 2009 00:04

I’ve never seen mailing articles as useeful, but it is a nice tip.

May 13 2009 19:49

I had concerns about using a mailto link on my site. I am testing how many people click on the link through Google Analytic Goals. We’ll see if we get any bump in traffic in relation to clicks.

Does anyone else know of a good way to track this?

Sep 16 2009 23:18

Just what I needed, the simple things are the hardest to do sometimes. I have only just discovered this site, I’m telling all my web designer buddies about it now, also it’s become my first stop for all things wordpress. Now subscibing to your blog too, thanks.

Trackbacks:

Leave a Comment

* Name, Email, Comment are Required