The basic way to link to an email address
A mailto link is HTML code that opens the reader's email program when they click it. The simplest version looks like this: <a href="mailto:name@example.com">Send us an email</a>. When someone clicks the words "Send us an email," their default email client opens with a blank message addressed to name@example.com.
You do not need to know HTML to create one. Most website builders, document platforms, and email services have a built-in button or menu option to insert a mailto link. In Google Docs, you highlight the text you want to link, click the link icon, choose "Email address," and type the address. In WordPress, you do the same through the link dialog. The platform writes the HTML for you.
The link works on desktop and mobile. On a phone, clicking it opens whatever email app the person has set as their default — Gmail, Outlook, Apple Mail, or another service. On desktop, it opens the email program installed on that computer.
Key Takeaways
- A mailto link opens someone's email program when clicked, with the recipient address already filled in.
- You can add a subject line and message body to the link so the email arrives partially pre-filled.
- Website builders and Google Docs have built-in buttons to create mailto links without writing code.
- Mailto links work on both desktop and mobile devices, opening whatever email app the person uses by default.
- Spammers harvest email addresses from mailto links, so consider hiding your address behind a contact form instead.
Adding a subject line and message body
You can make the email arrive with text already in it. The code looks like: <a href="mailto:name@example.com?subject=Question about your service&body=Hi, I wanted to ask...">Email us</a>. The ?subject= part fills in the subject line. The &body= part pre-fills the message.
In most website builders, you do not type this code yourself. Instead, you create the mailto link normally, then look for an "Advanced" or "More options" section where you can type the subject and message. Google Sites, Wix, and Squarespace all have these fields. If your builder does not show them, you may need to switch to code view or use a contact form instead.
Keep the pre-filled text short. If the message is long, people often delete it and write their own anyway. A subject line like "Question about pricing" or "I want to sign up" is more useful than a full paragraph.
Creating a mailto link in Google Docs
Open your document and highlight the text you want to turn into a link. Press Ctrl+K on Windows or Cmd+K on Mac. A dialog box appears. Click the email icon (it looks like an envelope) or type "email" in the search field. Type the email address and click "explore."
The text is now a clickable link. When someone opens the document and clicks it, their email program opens with that address in the "To" field. If you want to add a subject line in Google Docs, you have to edit the link in code view, which most people skip — a straightforward mailto link without a subject is usually enough.
Creating a mailto link in WordPress
Highlight the text you want to link. Click the link icon in the editor toolbar (it looks like a chain). In the search field that appears, type the email address. WordPress shows a "mailto:" option. Click it. The link is created.
To add a subject line in WordPress, you need to click the three-dot menu next to the link and choose "Edit as HTML," then manually type the subject parameter. Many WordPress users skip this step and just use a plain mailto link, since most visitors will type their own subject anyway.
Why email addresses in mailto links get spammed
Spammers use automated tools called email scrapers that crawl websites and pull out every email address they find, including ones hidden in mailto links. If you put your personal email address in a mailto link on a public website, you will likely receive more spam within weeks.
A contact form is safer. Instead of showing your email address, the form collects the message on your website and sends it to you behind the scenes. The visitor never sees your actual address. Most website builders include a contact form tool, and it takes about five minutes to set up. If you receive a lot of email already, a contact form reduces spam more than a mailto link does.
If you do use a mailto link, use an email address created just for that purpose — not your main personal or work email. Some people create a "contact@mysite.com" address separate from their regular inbox, so spam to that address does not clutter their main email.
Mailto links on social media and messaging apps
You can paste a mailto link into Facebook, Twitter, LinkedIn, or Instagram, and it works the same way — clicking it opens the reader's email program. However, most social platforms do not let you highlight text and turn it into a link the way a website does. You usually have to paste the full URL in plain text, which looks ugly and is straightforward to mistype.
On messaging apps like WhatsApp or Slack, a mailto link usually works if you paste the full code, but again, most people just type "email me at name@example.com" in plain text instead. It is simpler and the reader can copy the address if they want to use it.
Testing your mailto link
Before you publish a page with a mailto link, click it yourself to make sure it works. Your email program should open with the correct address in the "To" field. If nothing happens, the link may be broken — check that you typed the email address correctly and that there are no extra spaces.
Test it on both a computer and a phone if your page is public. Mobile email apps sometimes behave differently than desktop ones. If the link works on desktop but not mobile, it may be a problem with how your website builder handles the link on small screens.
Frequently Asked Questions
Can I make a mailto link open multiple email addresses at once?
Yes. Separate the addresses with commas: <a href="mailto:person1@example.com,person2@example.com">Email us</a>. When clicked, the email program opens with both addresses in the "To" field. This works in most email clients, though some older ones may not support it.
What happens if someone clicks a mailto link but does not have an email program installed?
Nothing happens. On phones, if the person has no email app set as default, the phone may ask them to choose one or show an error. On computers, if no email program is installed, the click does nothing. This is rare — most devices have at least one email app — but it is a reason some websites use contact forms instead.
Can I track whether someone clicked my mailto link?
No. Mailto links do not send any data back to you. You cannot see who clicked, when they clicked, or whether they actually sent the email. If you need that information, you need a contact form instead, which records submissions on your server.
Is it safe to put my email address in a mailto link on a public website?
It is not ideal. Spam scrapers will find it and add it to spam lists. A contact form is safer because your actual email address stays hidden. If you must use a mailto link, use a separate email address created just for that purpose, not your main personal or work email.
Do mailto links work in PDF files?
Yes. If you create a PDF in Google Docs, Microsoft Word, or Adobe, you can include a mailto link and it will work when someone clicks it in the PDF. The email program opens the same way it does on a website.