Support » How-To and Troubleshooting » [Resolved] "Mail to a friend" html code
6 years, 1 month ago
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!
<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>
works like a charm!
Thanks very much!
6 years ago
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@example.com>
my problem is, i don’t know how to turn the <firstname.lastname@example.org> 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.