Skip to content


Wordpress Hack: Send post to a friend by email December 2, 2009

Posted in How To. 268 views

Comments Off

You might have used or heard about Wordpress email plugin. But this hack will let your readers send your posts to their friends by email. it can be a good idea to create more traffic on your blog.

Simply paste the following function into your functions.php file, and that’s all.

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; 

}

If you enjoyed this post, please share!