Adding a 'share by email' link to a website
Incorporate an email sharing option on your website using the mailto:
HTML attribute.
Here's a quick and simple example:
Replace URL_HERE
with your website's URL. The subject
and body
attributes create the email's subject line and content.
User-friendly with visual cue
Enhance usability with a clickable email icon. Incorporate an img tag with alternative text for accessibility. Don't forget Rosie, the screen reader! 😄
Pick an icon matching your site's aesthetics. Size does matter, adjust accordingly! 📏
SEO and personalization
Craft your subject line and message body to provide an apt presentation of your content. Add rel="nofollow noreferrer"
to follow SEO best practices. Robots need love too! 🤖
Functionality test
Don't forget to test! Make sure the mailto:
link triggers the default email client with prefilled information. Some email clients might give you a curveball; be ready with cross-browser testing. 🚀
User experience and accessibility
Ensure alternatives for visually impaired users. Alternative text for the email icon is a small step for developers, but a giant leap for accessibility. 🦾
Warn users of possible pop-up blockers potentially hindering the mailto:
action. Not everyone appreciates unexpected pop-ups! 😓
Advanced personalization
Use HTML entities to encode special characters; they can be quite the characters messing the link. Special characters: the uninvited party crashers! 🎊
With advanced personalization, the email's body can hold much more room for creativity!
Was this article helpful?