smart-mailto JS library adds webmail picker to standard mailto links
A lightweight JavaScript package called smart-mailto enhances standard mailto: links by displaying a provider picker when clicked, letting users choose Gmail, Outlook, Proton Mail, or other webmail services instead of being routed to a desktop app. The open-source library is installed via npm and requires just a single initialization call, with no changes needed to existing HTML anchor tags. It uses a delegated click listener to handle all valid mailto: links on a page, including dynamically added ones, while preserving recipient, subject, and body values. Options such as copying the address or opening the default mail app are included by default, with a desktop native-app option available via a configuration flag. If the picker fails to load or the recipient address is invalid, the library falls back silently to the browser's original mailto: behavior.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in