What a mailto link does and when to use one
A mailto link is a piece of code that opens the reader's email program when they click it. Instead of typing an email address into your browser, the link does the work for you — it launches Outlook, Gmail, Apple Mail, or whatever email client the person uses, and fills in the "To" field automatically.
You use mailto links when you want to make it straightforward for someone to contact you without copying and pasting an address. A link is faster than asking someone to find your email in a document, and it reduces typos. Mailto links work in web pages, documents, emails, and anywhere else you can put a hyperlink.
The link itself is just text — it does not send anything or store information. It straightforward tells the computer "when clicked, open email and put this address in the To field." The actual email only gets sent if the person writes a message and clicks Send.
Key Takeaways
- A mailto link opens someone's email program and fills in the recipient address automatically when clicked.
- The basic format is mailto:yourname@example.com, and you turn it into a clickable link in your document or website.
- You can add a subject line, body text, and multiple recipients by adding parameters after a question mark.
- Mailto links work on computers and phones but may not work if someone has no email program installed or uses webmail only.
- Posting your email address as a mailto link on a public website makes it easier for spam bots to find and harvest your address.
How to create a mailto link in a web page or HTML document
If you are writing HTML code directly, a mailto link looks like this:
<a href="mailto:contact@example.com">Send me an email</a>
The text between <a> and </a> is what the reader sees and clicks on. The href="mailto:" part tells the browser what to do when they click. Replace contact@example.com with the actual email address.
If you are using a website builder like Wix, Squarespace, or WordPress, you do not need to write code. Instead, highlight the text you want to turn into a link, click the link button (usually a chain icon), choose "Email" from the menu, and type the address. The builder creates the code for you.
Adding a subject line and message body to your link
You can make the link even more useful by pre-filling the subject line and even the first line of the message. This is helpful when you want people to email you about a specific topic.
The format is:
<a href="mailto:contact@example.com?subject=Question%20About%20Your%20Service&body=Hello,%20I%20would%20like%20to%20ask%20about...">Email us</a>
Notice the question mark after the email address — that is where parameters start. subject= sets the subject line. body= sets the opening text. Use %20 for spaces and %0A for line breaks. The ampersand (&) separates multiple parameters.
Most website builders do not have a straightforward way to add subject lines and body text through the visual editor. If you need this feature, you may have to paste the code into the HTML editor or use a mailto link generator tool.
Creating a link with multiple recipients
You can send to more than one person by separating addresses with a semicolon:
<a href="mailto:person1@example.com;person2@example.com">Email the team</a>
Some email clients use a comma instead of a semicolon, so results vary. If you need to send to multiple people reliably, it is safer to list only one address in the mailto link and ask the reader to add others manually, or to use a contact form instead.
You can also add a CC or BCC field. The format is ?cc=address@example.com or ?bcc=address@example.com. Combine them with an ampersand: mailto:person@example.com?cc=copy@example.com&subject=Hello
Why mailto links may not work for everyone
A mailto link only works if the person has an email program installed on their device. If someone uses Gmail, Outlook, or Apple Mail through a web browser, the link may not open anything — or it may open their browser version instead of their installed program.
On phones and tablets, mailto links usually work better because email apps are built in. On computers, the behavior depends on what the user has set as their default email program.
If you want to reach people who might not have email set up, use a contact form instead. A form collects their message through your website and sends it to you, so it works for everyone.
Protecting your email address from spam bots
Posting a mailto link with your real email address on a public website makes it easier for automated spam bots to find and harvest your address. Bots scan web pages for the mailto: pattern and collect addresses to sell or use for spam.
If you publish your email publicly, expect more spam. You can reduce this by using a contact form instead of a mailto link, or by writing your address as text (like "contact at example dot com") and asking people to type it in manually. Some websites use JavaScript to hide the mailto link from bots, but this is not foolproof.
If spam becomes a problem, you can create a separate email address just for your website and filter messages from it, or use email forwarding to send website messages to your main inbox.
Testing your mailto link before publishing
Before you publish a page with a mailto link, click it yourself to make sure it works. The link should open your email program and show the correct address in the To field. If nothing happens, check that you spelled the address correctly and that you have an email program installed.
Test on both a computer and a phone if your page will be viewed on both. The behavior may differ — a phone might open a different email app than your computer does.
If you added a subject line or body text, verify that it appears correctly. Some special characters do not encode properly, so if you see strange symbols instead of your text, you may need to adjust the formatting.
Frequently Asked Questions
Can I use a mailto link in a Word document or PDF?
Yes. In Word, highlight text, right-click, choose "Link," then select "Email Address" and type the address. In a PDF, you can add a link the same way, but the behavior depends on what program the reader uses to open the PDF. Some PDF readers open email; others do not.
What happens if someone clicks a mailto link but does not send the email?
Nothing. The link only opens their email program and fills in the To field. No message is sent unless they write one and click Send. You will not know they clicked the link.
Can I track whether someone clicked my mailto link?
No. Mailto links do not send any information back to you. If you need to know whether someone received your message or clicked a link, use a contact form or a tracked email service instead.
Why does my mailto link work on my computer but not on my phone?
Your phone and computer may have different default email programs. On a computer, the link opens whatever program you set as default — often Outlook or Thunderbird. On a phone, it usually opens the built-in Mail app. If your phone has no email app installed, the link may not work at all.
Is there a way to make a mailto link that works for everyone?
A contact form is the most reliable option because it works on any device with a web browser, regardless of whether the person has email set up. Mailto links are convenient for people who do have email, but they are not universal.