Convert the Mailto Hyperlinks into a Contact Form
Websites use the mailto protocol to convert plain-text email addresses into hyperlinks. When someone clicks an hyperlinked email address, it opens a new message in their default email program allowing them to quickly compose and send an email to that particular address.
Some website owners hide their email addresses but instead offer inline contact forms allowing visitors to reach them directly without having to use an external email program.
To get a taste of how this thing works, click my email address email@example.com - this is a standard mailto link but instead of opening a message in your email program, you should see a modal contact form in the browser.
When someone contacts you via the SquareSend enabled mailto link, you’ll get a copy of the message in your primary mailbox and a copy will also be delivered to your SquareSend account. The service supports custom parameters allowing you to easily customize forms.
SquareSend is a freemium service. You can associate up to five different email addresses with your account and the free plan would allow you to receive up to 50 email messages per month.
The email address on your web page can be easily harvested by spam bots but if you are on WordPress, there’s a little-known function called antispambot that will hide your address behind HTML characters making it nearly invisible to spam bots.
// This will appear as a regular email address to humans but spam // bots will only see some weird HTML characters <a href='mailto:<?php echo antispambot("firstname.lastname@example.org"); ?>'> <?php echo antispambot("email@example.com"); ?> </a>
Just use the above snippet wherever you wish to display your email address and you should be safe. Human visitors will see the regular email address while bot will see some weird HTML characters.
If you aren’t on WordPress, see other ways to hide your email address on websites.
Google Developer Expert, Google Cloud Champion
Amit Agarwal is a Google Developer Expert in Google Workspace and Google Apps Script. He holds an engineering degree in Computer Science (I.I.T.) and is the first professional blogger in India.