Code: Add an “Email This” Button
June 19th, 2009
When building a blog that offers a lot of useful content and resources (rather than opinion), we strongly recommend blogs offer an easy way for readers/users to email your content to their friends and family.
If you’d like to do this on your blog, this is actually pretty easy! The following code is designed to allow readers to click on the button and have it open up their default email software. It wil even create a subject and link that points to the post the reader is currently visiting! Here is the javascript code you will need:
<script type="text/javascript">
<!-- Begin
function isPPC() {
if (navigator.appVersion.indexOf("PPC") != -1) return true;
else return false;
}
if(isPPC()) {
document.write('<a HREF=\"mailto:\?subject\=Take a look at this page I found, ' + document.title + '?body=You can see this page at: ' + window.location + '\" onMouseOver="window.status=\'Send your friends e-mail about this page\'; return true" TITLE="Send your friends e-mail about this page">Email to a Friend<\/a>');
}
else { document.write('<a HREF=\"mailto:\?body\=Take a look at this page I found titled ' + document.title + '. You can see this page at: ' + window.location + '\" onMouseOver="window.status=\'Send your friends e-mail about this page\'; return true" TITLE="Send your friends e-mail about this page" rel="nofollow">Email This!<\/a>');
}
// End -->
</script>
This code will create an “email this” link on your blog, allowing your readers to simply enter in someone’s email address and click send to share your content with others.

