E-Mail A Post WordPress Function
I’ve been thinking about this, and came up with a solution, which you can see in the sharing options on this page (between the post title and content, and again at the end of the article). Using the mailto: href and the mailto URL scheme, with a click of a button you can create a new email message with the subject pre-populated with the post title, and the message body containing the post description and URL.
<a href="mailto:?subject=<?= urlencode(get_the_title($post->ID)) ?>&body=<?= urlencode(get_permalink($post->ID) . "\n" . get_post_meta(get_the_ID(), '_yoast_wpseo_metadesc', true)) ?>" target="_blank"><img src="/wp-content/themes/thesis_18/custom/images/icon-email.png" width="59" height="20" border="0" alt="Email" /></a>
To get rid of “smart” quotes in the post title (e-mail subject), I also added
No third party tools. No forms to fill out. Just click a button, and a user can email your page.
It’s the original sharing tool.