Send Article to a Friend by Email

/ Published in: PHP
Save to your folder(s)

Copy this code and paste it in your HTML
  1. Just paste the function below into your functions.php file.
  3. function direct_email($text="Send by email"){
  4. global $post;
  5. $title = htmlspecialchars($post->post_title);
  6. $subject = 'Sur '.htmlspecialchars(get_bloginfo('name')).' : '.$title;
  7. $body = 'I recommend this page : '.$title.'. You can read it on : '.get_permalink($post->ID);
  8. $link = '<a rel="nofollow" href="mailto:?subject='.rawurlencode($subject).'&body='.rawurlencode($body).'" title="'.$text.' : '.$title.'">'.$text.'</a>';
  9. return $link;
  10. }


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.