A mailto link turns a plain email address on your website into a clickable link that opens the visitor's email app with everything ready to go.
Instead of asking people to copy your address, you let them click once and start writing.
Creating a mailto link in HTML is simple, and you can even pre-fill the subject and message.
This guide explains the syntax, how to add a subject and body, and the small details that make a mailto link work reliably.
A mailto link is a standard web link that uses the mailto: scheme instead of http.
When someone clicks it, their device opens its default email program with a new message addressed to you.
It is the normal way to add a contact email to a web page, a footer, or an email signature.
Because it relies on the visitor's own email app, a mailto link works everywhere without any server-side code. It is pure HTML.
At its simplest, a mailto link looks just like a normal link, but the href starts with mailto: followed by the address:
The link text is whatever you want people to see, such as "Email us" or the address itself. The href value is mailto: plus the email address.
So a basic mailto link points its href to mailto:hello@example.com, and the clickable text can read "Email us." That is all you need for a working email link.
The real power of a mailto link is pre-filling the email. You can add a subject line and a message body so the visitor's email opens partly written.
This is done by adding parameters after the address, starting with a question mark.
Subject is added with ?subject= followed by your text. Body is added with &body= followed by your message.
The one rule to remember is that spaces and special characters must be encoded. A space becomes %20 and a line break becomes %0A.
If you do not encode them, some email apps will cut off the subject or body. This is exactly the kind of fiddly detail that is easy to get wrong by hand.
You can also pre-fill carbon copy and blind carbon copy recipients:
CC uses &cc= followed by the address. BCC uses &bcc= followed by the address. Multiple recipients are separated by commas in any of the fields.
So a single link can address your support inbox, copy a manager, and add a subject line, all before the visitor types a word.
Please share by clicking this button!
Visit our site and see all other available articles!
What Is Lorem Ipsum and Why Designers Use It