The Full mailto Link Syntax

sending email through mailto linksFor a small project, I had to create a smart mailto link to make my life a bit easier. I wanted the mailto link to hold not only a to and the subject (I’d figured that much out) but a multi-lined body too. Turns out that is pretty darn easy to do. So, for my own reference, and yours, here’s a complete overview of everything possible with a mailto link.

There are a couple of variables you can use, which you’d have to do in standard URL format, remember to properly encode the & if you care about the validity of your HTML, so you use & in that case. Here’s the full mailto link syntax:

[code lang=”html”]<a href="mailto:info@example.com?subject=subject&cc=cc@example.com">mail link</a>[/code]

Here are the variables you can use in mailto links:

mailto: to set the recipient, or recipients, separate with comma
&cc= to set the CC recipient(s)
&bcc= to set the BCC recipient(s)
&subject= to set the email subject, URL encode for longer sentences, so replace spaces with %20, etc.
&body= to set the body of the message, you can add entire sentences here, including line breaks. Line breaks should be converted to %0A.

Some mailto link examples

A simple mailto link:

[code lang=”html”]<a href="mailto:info@example.com">mail link</a>[/code]

mailto link with subject:

[code lang=”html”]<a href="mailto:info@example.com?subject=email%20subject">mail link</a>[/code]

mailto link with multiple recipients:

[code lang=”html”]<a href="mailto:info@example.com,email@example.com">mail link</a>[/code]

mailto link with a CC:

[code lang=”html”]<a href="mailto:info@example.com?cc=email2@example.com">mail link</a>[/code]

A mailto link with message body already started:

[code lang=”html”]<a href="mailto:info@example.com?body=these%20mailto%20links%20are%20cool">
e-mail link
</a>[/code]

A mailto link with 3 lines of message body:

[code lang=”html”]<a href="mailto:info@example.com?body=these%20mailto%0Alinks%20are%0Acool">
mail links
</a>[/code]

A mailto link with 3 lines of message body and a BCC:

[code lang=”html”]<a href="mailto:info@example.com?bcc=mail2@example.com
&body=these%20mailto%0Alinks%20are%0Acool">
mailto links
</a>[/code]

As you can see, you can add as many of these as you want and stack them on top of each other. Remember that after the email address you’ll use a question mark to prefix the first variable, and ampersands ( & ) for each consecutive variable.

Happy coding and mailing!

Webinar

Introduction to Yoast SEO webinar

17 March 2026

Discover how to effectively use the Yoast SEO plugin. Get hands-on tips for setup, content optimization, and more.

All Yoast SEO Webinars
Event

Baltic-Nordic SEO Summit

March 20 - 21, 2026

Team Yoast is Attending, Sponsoring, Yoast Booth at Baltic-Nordic SEO Summit! Click through to see who will be there, what we will do, and more!

See where you can find us next
Podcast

Podcast

26 March 2026

Add main headingMain heading optional second line Gain invaluable SEO insights and expert analysis One morning, when Gregor Samsa woke from troubled dreams, he found himself transformed in his bed into a horrible vermin. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim […]

All Yoast SEO Podcasts

Discussion (29)