What a mailto link does and when you need one
A mailto link is a piece of code that turns text or a button into something a visitor can click to send you an email. When someone clicks it, their default email program opens with your address already filled in — they just type their message and send. You use mailto links when you want people to contact you directly from a webpage, document, or email signature without having to copy and paste your address.
This is different from straightforward typing your email address as plain text. Plain text requires someone to manually copy it, open their email, paste it in, and start typing. A mailto link does all that work for them in one click.
Key Takeaways
- A mailto link is written as <a href="mailto:youraddress@example.com">Click here to email us</a> in HTML, where the text between the tags is what visitors see and click.
- In most word processors and website builders, you can create a mailto link by highlighting text, selecting "Insert Link" or "Hyperlink", and typing mailto: followed by the email address.
- Mailto links work on computers, phones, and tablets as long as the device has an email program set up, but they do not work for people who use webmail-only (like Gmail in a browser with no desktop email client).
- You can add a subject line to a mailto link so the email opens with pre-filled text, using the format mailto:address@example.com?subject=Your%20Subject%20Here.
Creating a mailto link in HTML
If you are writing HTML code directly, the basic structure is straightforward. Open a link tag with <a href="mailto:youraddress@example.com">, then type the text you want visitors to see, then close the tag with </a>. The text between the opening and closing tags is what appears on the page — the visitor clicks that text, not the code itself.
Here is a real example: <a href="mailto:support@example.com">Email our support team</a> would display as a clickable link saying "Email our support team". When clicked, it opens the visitor's email program with support@example.com in the "To" field.
If you want to add a subject line so the email opens with text already in the subject field, use a question mark after the address: <a href="mailto:support@example.com?subject=Website%20Inquiry">Contact us</a>. Notice the %20 — that is how spaces are written in web code. If you need multiple words in the subject, replace each space with %20.
Creating a mailto link in Word, Google Docs, or similar programs
Most word processors and document editors have a built-in way to create links without typing code. Highlight the text you want to turn into a link, then right-click and look for "Insert Link", "Hyperlink", or "Link" — the exact wording varies by program. In Microsoft Word, you can also use Ctrl+K (Windows) or Cmd+K (Mac).
A dialog box will open asking where the link should go. Instead of typing a web address, type mailto: followed by the email address with no space. For example: mailto:contact@example.com. Some programs have a dropdown menu where you can select "Email" as the link type, which fills in the mailto: part for you — just type the address.
In Google Docs, highlight your text, click the link icon (it looks like a chain), select "Email" from the menu, type the address, and click "explore". The process is similar in other Google products like Sheets and Slides.
Creating a mailto link in website builders
Website builders like Wix, Squarespace, and WordPress have their own link tools. In most cases, you highlight the text or button you want to link, click an "Add Link" or "Link" button, and a menu appears. Look for an option that says "Email" or shows an envelope icon. Click that, type your email address, and save.
Some builders let you add a subject line in the same dialog. If you see a field for "Subject" or "Message", fill it in — this text will appear in the subject line when the email opens. If there is no subject field in your builder, you can still add one by editing the code directly if your builder allows it, using the format shown in the HTML section above.
What happens when someone clicks a mailto link
When a visitor clicks a mailto link on a computer, their default email program launches — usually Outlook, Apple Mail, Thunderbird, or whatever they have set as their email client. The "To" field is already filled with your address. If you included a subject line, that appears in the subject field too. The visitor types their message and clicks send.
On a phone or tablet, clicking a mailto link opens the device's default email app (Gmail, Apple Mail, Outlook, etc.) with the same pre-filled information. This works the same way whether the link is on a website or in a document.
One important limitation: mailto links only work if the person has an email program installed and set as their default. Someone using Gmail only in a web browser, with no desktop email client, will see an error or nothing will happen. For that reason, many websites show their email address as plain text alongside the mailto link, so visitors can copy it manually if needed.
Adding extra information to a mailto link
Beyond the subject line, you can add a message body, CC field, or BCC field to a mailto link. These are less commonly used but helpful if you want the email to open with specific instructions or context already written in.
The format is: mailto:address@example.com?subject=Subject%20Here&body=Message%20text%20here&cc=other@example.com. Each field is separated by an ampersand (&). Again, spaces become %20. Line breaks in the body become %0A. This gets complex quickly, so most people stick with just the address and subject line.
Testing your mailto link
After you create a mailto link, test it before publishing. Click the link yourself and make sure your email program opens with the correct address in the "To" field. If you added a subject line, verify it appears correctly. If nothing happens when you click, check that you typed mailto: correctly — it is a common place to make typos.
If you are building a website, test the link in multiple browsers (Chrome, Firefox, Safari, Edge) and on a phone if possible. Different devices and email setups can behave differently, so testing catches problems before visitors encounter them.
Frequently Asked Questions
Can I use a mailto link in an email I send to someone?
Yes, but it depends on the email program. Most desktop email clients (Outlook, Apple Mail, Thunderbird) support mailto links in emails. Web-based email like Gmail usually does not — the link may not work or may open your browser instead of your email program. Test with your specific email program before relying on it.
What if I want to link to multiple email addresses at once?
You can separate multiple addresses with commas: mailto:address1@example.com,address2@example.com. All addresses will appear in the "To" field when the email opens. This is useful for team contact pages where you want visitors to email multiple people at once.
Do mailto links work on mobile phones?
Yes, they work the same way on phones and tablets as on computers. Clicking a mailto link opens the device's default email app with your address pre-filled. The experience is identical to the desktop version.
Can I style a mailto link to look different from other links?
Yes, if you are working with HTML or a website builder that allows CSS styling. You can change the color, font, size, or add a button background the same way you would style any other link. The styling does not affect how the link works — it only changes how it looks on the page.
What if someone's email program is not set up on their device?
The mailto link will not work. For this reason, many websites display the email address as plain text next to or below the mailto link, so visitors can copy it manually if needed. This is a good practice for accessibility and reliability.