A mailto link is a special type of hyperlink that, when clicked,
opens the user's default email client with a new compose window.
It's based on the RFC 6068 standard and uses the mailto: URI scheme.
Why use mailto links instead of contact forms?
Advantages
✅ Simple to implement -
No server-side processing required
✅ Direct - Opens in user's
preferred email client
✅ Familiar - Users know
exactly what will happen
✅ Reliable - No dependency
on your server
Disadvantages
❌ Depends on user configuration - Requires configured email client
❌ Less control - Can't customize
the sending process
❌ No analytics - Harder
to track email sends
The Complete Mailto Syntax: A Deep Dive
Understanding the syntax of mailto links is key to unlocking their
full potential. Let's break down the structure from the simplest
form to a complex, multi-parameter link.
The Anatomy of a Mailto Link
A mailto link is constructed with specific components that must be
in the correct order:
The Scheme: Every mailto link must begin with mailto:.
The Recipient: Immediately follows the scheme (e.g.,
mailto:[email protected]).
The First Parameter: Added after the recipient using
a question mark ? (e.g., ?subject=Hello).
Subsequent Parameters: Chained together using an
ampersand & (e.g., &body=Hi).
A Deep Dive into All Mailto Parameters
While the recipient's email is the only mandatory part, you can
add several optional parameters to pre-fill the email draft,
making it easier for your users.
The `subject` Parameter
This parameter pre-fills the email's subject line. This is one of
the most useful parameters. Remember to URL-encode any special
characters to avoid breaking the link.
The `body` parameter pre-populates the main content of the email.
A common challenge is adding line breaks. To do this correctly,
you must use %0A to represent a new
line.
<a href="mailto:[email protected]?body=Hello%20Team,%0A%0AI have a question...%0A%0ABest regards,">Ask a question</a>
The `cc` & `bcc` Parameters
You can add "carbon copy" (`cc`) and "blind carbon copy" (`bcc`)
recipients. This is useful for keeping team members in the loop
without requiring the sender to manually add them.
Let's combine multiple parameters into one powerful mailto link.
This example sets a recipient, a CC recipient, a subject, and a
multi-line body, showing the true power of mailto links.
<a href="mailto:[email protected][email protected]&subject=New%20Inquiry%20%26%20Feedback&body=Hello%20Sales%20Team,%0A%0AI have an inquiry about your product...%0A%0AThanks!">Contact Sales and Support</a>
Avoid Errors, Use the Generator!
Manually encoding special characters and line breaks is tedious
and error-prone. Use the interactive generator at the top of
this page to create perfect mailto links every time. It's the
best way to ensure your links work flawlessly across all email
clients.
Multiple Recipients in Mailto Links
Adding Multiple Recipients
To add multiple recipients in a mailto link, separate email
addresses with commas. This works for the main recipient (To),
CC, and BCC fields.
You've crafted what you think is the perfect mailto link, but when
you click it... nothing happens. Don't panic! Most mailto link
issues have simple fixes.
7 Common Problems & How to Fix Them
1. Encoding Special Characters
This is the #1 cause of broken mailto links. Special
characters like spaces, ampersands, and question marks must be
properly URL-encoded.
❌ BROKEN:
<a href="mailto:[email protected]?subject=Hello World&body=Hi there, How are you?">
The mailto protocol depends on having a default email client
configured. If users haven't set one up, clicking links won't
work.
Does mailto work with Gmail? Yes! Gmail handles mailto links excellently in web browsers.
3. Character Limits
Outlook has a roughly 2,000-character limit for mailto URLs.
Keep your links concise to ensure compatibility.
4. Simple Syntax Errors
Common "face-palm" moments include:
Missing colon after mailto
Missing question mark ? before first parameter
Using question mark instead of ampersand & between parameters
5. Line Break Issues
Line breaks in the body must be encoded as %0A. Using actual line breaks will break the URL parsing in many
email clients.
6. CMS or Framework Conflicts
Some content management systems or JavaScript frameworks
automatically modify href attributes, potentially breaking
your mailto links. Always check the final rendered HTML.
7. Mobile Device Configuration
On mobile devices, mailto links depend on having an email app
installed and configured. If users only use webmail, mailto
links might not work as expected.
The Ultimate Fix
The single best way to avoid all these headaches is to let a
specialized tool handle the complexities for you.
Our free Mailto Link Generator automatically takes care of perfect URL encoding, proper syntax
validation, cross-client compatibility, and character limit warnings.
While there's no official limit, we recommend keeping mailto
links under 2000 characters for maximum compatibility. Some
email clients (especially older versions of Outlook) may have
issues with longer links.
Can I use HTML in the body of a mailto link?
No, mailto links don't support HTML formatting in the body. The
body text will be plain text only. Any HTML tags will be shown
as literal text.
Why isn't my mailto link opening in Gmail?
If you're using Gmail in a browser, you need to set Gmail as
your default email client in your browser settings.
Alternatively, you can configure your operating system to use
Gmail as the default email application.
How do I add line breaks in the email body?
Use %0A or %0D%0A for line breaks. For example: body=Line1%0ALine2
Can I attach files using mailto links?
No, the mailto protocol doesn't support file attachments. For
security reasons, you cannot pre-attach files to an email using
a mailto link.
How do I create a QR code for my mailto link?
Use the "Generate QR" button above to create a QR code for your
mailto link. The QR code can be scanned by mobile devices to
quickly open the email composition with all your pre-filled
details.
What are the benefits of using QR codes for mailto links?
QR codes make it easy to share complex mailto links on printed
materials, business cards, or websites. Users can simply scan
the code to open their email client with all fields
pre-populated, eliminating typing errors.
We use cookies to enhance your browsing experience, serve
personalized ads or content, and analyze our traffic. By
clicking "Accept All", you consent to our use of cookies.
Read our Privacy Policy.