DISCLAIMER: this post is older than one year and may not be up to date with latest WordPress version.

In order to create more traffic on your blog, it can be a good idea to let your readers send your posts to their friends by email. A few month ago, I already shown you a function to do that, here is an improved version for today.

To apply this recipe to your blog, simply paste the following function into your functions.php file, and that’s all. Hard to do something simpler!

function direct_email($text="Send by email"){
        global $post;
        $title = htmlspecialchars($post->post_title);
        $subject = 'Sur '.htmlspecialchars(get_bloginfo('name')).' : '.$title;
        $body = 'I recommend this page : '.$title.'. You can read it on : '.get_permalink($post->ID);
        $link = '<a rel="nofollow" href="mailto:?subject='.rawurlencode($subject).'&amp;body='.rawurlencode($body).'" title="'.$text.' : '.$title.'">'.$text.'</a>';
        return $link;

Thanks to : WebInventif.fr for the awesome trick!

Also, I got some exiting news for you : First, Chris Coyier and Jeff Starr just released their first ebook, called “Dig into WordPress“. I recommend you to have a look at it!

Second, I have some great WordPress related domain names for sale:
wpdoc.com : Stands for both “WordPress Doctor” or “WordPress Documentation”. DEFINITELY a great opportunity if you’re looking to start your own WOrdPress related site or business. Price is $25.

wpplr.com : Stands for WordPress Private Label Right. Wonderful opportunity if you’re looking to create and release PLR WordPress themes! Price is only $15!

wp3k.com : Stands for WordPress 3000. I only ask $15 for this 4 characters domain.

If you want one of them, simply send me an email. First come, first served, so be quick!



  1. Hi, thanks for the code for this, but I’ve tried it, and I can’t see that anything is happening. I added the code to my “functions.php” file, but now I don’t know how to get it to appear on the page.

    Can you enlighten me? Thanks a bunch for all your work!!!

  2. @Dave, if I understand the code correctly, then you are intended to write


    anywhere you want to have the link appear, but I’m going to test it out for myself, so I’ll let you know if that is not the case.

  3. I don’t get it. This code or the way it was explained seems to be incomplete. After placing this into function then what!?
    There needs to be something which calls it. Please anyone help to complete this tutorial.


  4. In template (single.php for exemple) put to call the function.
    Share this post by this post
    Working WELL

  5. Nikhil Naik

    It’s nice to see small codes exists to perform such tasks instead of having to install a plugin for the same. Don’t we need to make any changes in the single.php for this function to be made visible in the post page?

  6. Hey folks. I dropped this into my functions.php file. But where exactly do I use the function direct_email() ?

    Do I do something like this?


    I’m using a custom image.

Leave a Comment

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