Content · Web Development · HTML

HTML Mailto Links with Subject and Body Parameters

Mailto addresses can include a subject or body in URL parameters. Those values need URL encoding because spaces and special punctuation have meaning in a URL.

1 views Published Oct 19, 2026 Updated Oct 19, 2026 Admin

Mailto addresses can include a subject or body in URL parameters. Those values need URL encoding because spaces and special punctuation have meaning in a URL. The important question is always where the link leads and whether the person reading the page can predict it.

What You Need to Know


A mailto link starts an email composition flow where supported; it cannot send the message silently or guarantee the recipient receives it.

Modern browsers implicitly provide noopener behavior for target="_blank", but explicitly stating it helps explain the security intent.

Links are the pathways through a website. The words on a link should help someone choose where to go before clicking it.

Example: See It in Action


Here is a simple example to experiment with. Type it, save the file, and check what the browser displays.

This is a short HTML fragment. To try it as a webpage, put it inside the body element of a complete HTML document.

<a href="mailto:[email protected]?subject=Homework%20question">
    Email a homework question
</a>
<p>Encode spaces and special characters in URL parameters.</p>

Let’s Understand the Example


  • An a element becomes a working link when it has an href. Its visible text should tell readers where they will go.
  • A p groups a paragraph of related text. Start another paragraph for a new thought.
  • Href contains the destination of a link. A value starting with # points to an id on the same page.

The first example link points to mailto:[email protected]?subject=Homework%20question. Check whether that destination exists relative to the document. A link changes where readers go; it does not perform an action such as saving a form.

What Should You See?


You should see a link named “Email a homework question”. Selecting it leads to mailto:[email protected]?subject=Homework%20question when that destination exists. Try it with the mouse and the keyboard.

Imagine this link is read out of context. Would its text still explain the destination? Rename unclear links before trying to make them look nicer with CSS.

Try It Yourself


  1. Add a short, safely encoded subject to a school-club email link.
  2. Save your changes, open or refresh the page, and compare the result with the original example.
  3. Tell a friend what your change did. If you are not sure, undo it, refresh the page, and compare.

Common Beginner Mistakes


  • Placing raw spaces or & characters in mailto parameters without encoding them.
  • Avoid dead links, empty href values and clickable-looking text without a real destination.

Key Takeaways


  • Mailto addresses can include a subject or body in URL parameters.
  • An a element becomes a working link when it has an href. Its visible text should tell readers where they will go.
  • Modern browsers implicitly provide noopener behavior for target="_blank", but explicitly stating it helps explain the security intent.
Share this resourceSend this page to someone who may find it useful.