Support » Fixing WordPress » "Mail to a friend" html code

  • Resolved kadr

    (@kadr)


    Hey,

    I’d like to know what kind of code snippet I can add to a post so that users can send the article to a friend.

    Ideally the link should open the default mail program, create a new message with an empty address field, but with the name of the blog entry in the subject field and a link to the article in the body.

    Thnx for any help on this!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Try:

    <a href="mailto:blank?subject=<?php the_title(); ?>&body=I thought you might be interested in <?php the_title(); ?>. You can view it at: <?php the_permalink() ?>">Send to a friend</a>

    Thread Starter kadr

    (@kadr)

    works like a charm!
    Thanks very much!

    hi, i think this is related to the above question. i’m using this code…

    $out .= "<br />". __("Send a thanks to","wp-greet")." </th><td>". $res->fromname . " <" . $res->frommail . ">";

    …to display the following message:

    Send a thanks to Name <email@domain.com>

    my problem is, i don’t know how to turn the <email@domain.com> into a link so that when clicked it launches an email client and sets it as the “to” field, much like mailto: would do.

    is this possible? any hints would be appreciated.

    thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘"Mail to a friend" html code’ is closed to new replies.