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.
  2.  
  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. }

URL: http://www.webinventif.fr/wordpress-lien-envoyer-page-mail/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.