How to use Mailto links

Mailto links not working guide.

Mailto not working right? Chances are, you're making a simple mistake that is causing your link to not open your default email client. Understanding a little about mailto link can also help. The link, placed inside of the <a> tag – like this <a href="email@example.com">mail me</a> – is used inside of HTML to open an email client with the email address inside of the tag.

If you add commas, you can send the same email to multiple recipients.

If you want to customize your mailto links, you can. But each new addition to your link adds another opportunity to make a mistake. A missing comma or quotation mark can cause an error, but there's a problem: you should pre-populate as much information as possible so that the sender doesn't have to fill in additional information.

A few of the key customization options, which are added inside of the same <a> tag that the mailto link exists, are:

  • Subject: Add subject=Name%20of%20subject%20goes%20here
  • Body: Add body=text%20inside%20of%body
  • CC and BCC: You can cc someone or bcc someone using the following cc=me@example.com&bcc=me2@example.com

Each customizaion must be added using the query parameter url encoded style. When you need to make spaces, be sure to use %20 to indicate a space rather than using a space that will break the coding. Keep in mind that ? goes before the first customization parameter and & goes before subsequent customization parameters.

A full example may look something like this:

<a href="mailto:test@example.com?cc=me@example.com&bcc=me2@example.com&subject=Name%20of%20subject%20goes%20here&body=text%20inside%20of%body">Example link</a>

If you want to open the mailto link in a new window, you can add in target=blank which is recommended to add to your user experience. Small mistakes in your syntax can lead to your mailto not working properly.

If your mailto link isn't working still, the fix is likely easy. Usage is simple, so the most common issues you'll come across are:

  • Email addresses not typed out properly
  • Field input is incorrect
  • Default clients aren't working properly

When the default email client won't open properly, it's an issue on the user's end. The user will need to set the appropriate client as their default. For example, they may use Gmail but never setup their Outlook, so Outlook opens.

The user would need to change the default client based on their operating system, whether it be Windows, Mac, iOS, Android, Linux or others. Otherwise, if you're still having issues with mailto link not working, you'll want to go through your HTML and ensure:

  • Syntax is correct
  • You have the right email and other data in place
  • You're not missing a quotation mark or comma

Oftentimes, skimming through your coding when you have an issue with mailto not working is all you need to correct the issue. You may also want to reconsider your approach. While mailto still works well, contact forms can help stop bots from harvesting your email address, can include a variety of fields, and there are a lot of free and paid form builders available. From a user standpoint, it's easier to fill in a contact form, and it will also allow you to retrieve more information from the sender.

Related content

Java email library for SMTP and creating email addresses

MailSlurp Java SDK for sending and receive email and attachments on the JVM.

Email for testing

Test email accounts for email testing. Alternatives to Mailinator, MailTrap, Mailosaur and more.

Email marketing campaign bulk email testing

Send bulk transactional emails with MailSlurp online or in code using CSharp, Node.js, Java, PHP and more.

Cold Emailing in Compliance with CAN-SPAM

How to maintain a strong sender reputation and delivery when cold emailing

Do's and Don'ts for multiple SPF records

Do's and Don'ts for multiple SPF records

Email Over Blockchain

Can emails be sent over blockchain? Well kind of! LedgerMail and other and at the cutting edge of decentralized email.

Explaining Cloud Email with Options to Think About

Explaining Cloud Email with Options to Think About

GraphQL Email API Tutorial

Did you know you can send and receive emails using GraphQL?

How to choose the right email design size (for various campaigns)

Email sizes can be instrumental to determine if your consumer will comprehend and engage with your content. While the template width (600 px) is typical, there are nuances to be mindful of. There are no hard and fast standards for email template height like design blocks.

HTML Mailto Links Explained

HTML Mailto is uncomplicated to use. This link opens the default email client and adds a new notification maker. Pre-populated fields save time and prevent email bounces. This post will cover customizing mailto. We'll also discuss its viability in this decade. Come on.

How to send emails in Javascript (NodeJS)

JS SMTP email sending guide using HTML and NodeJS.

Mailinator alternative

Alternatives to Mailinator for test email accounts. Create real email addresses using MailSlurp

How to use Mailto links

Mailto links not working guide.

Manage Email Throttling Correctly!

Manage Email Throttling Correctly!

Maximum Email Size and How to Optimize It

Email sizes are fundamental for a few important reasons. One is security, and another is the performance of your email.

Transactional Email Services Compared

Sending emails is important for many applications. Top 10 transactional email services compared.

What is DKIM Email

How to setup and configure DKIM signatures with the sender policy framework (SPF)

CSharp Email Tutorial

SMTP mailserver testing and usage in CSharp using

Email internationalization and i18n localization

Email internationalization and i18n localization

Ready to dive in?Start building email applications today.