Posted By

gd6d on 12/13/09


Tagged

mail wordpress send article


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

BrianCoyDesign


Send Article to a Friend by Email


 / Published in: PHP
 

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

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

Report this snippet  

You need to login to post a comment.