ForHosting KIT · Developer Utilities

Mailto link builder

Give support@example.com a subject and a body, and get a ready-to-paste mailto link where Hello from the web becomes Hello%20from%20the%20web and every space, accent or ampersand is safely encoded. It also splits an existing link into its parts. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Calculation mode
Encode
To
support@example.com
Subject
Hello from the web
Body
Please review the attached notes.
Cc
ops@example.com
Bcc
archive@example.com
You get
Query param count
4

Building those links by hand is easy until a space, accent, ampersand, or line break appears—then the query string breaks, the subject truncates, or the body arrives as one long corrupted line. This mailto link builder accepts recipient addresses plus optional subject, body, cc, and bcc fields, percent-encodes each header the way browsers and RFC 6068 expect, and returns a ready-to-paste mailto URI. In the other direction it parses an existing mailto link back into structured fields so you can audit templates, migrate CMS content, or round-trip values through your own forms.

What a mailto URI carries and why encoding matters

A mailto URI starts with the mailto scheme, then a path of one or more email addresses separated by commas, then an optional query string of header fields. The headers that matter for everyday product work are subject, body, cc, and bcc. Without encoding, a subject that contains an ampersand looks like a second parameter, a body with newlines collapses or is rejected by strict parsers, and an accented word becomes a broken sequence of bytes.

Recipients on the path and in cc or bcc are validated as simple local-part at domain addresses with a dotted domain so typos like support@example are caught early. Multiple recipients may be listed with commas; empty optional headers are omitted from the generated link so the URI stays short and readable.

Where a mailto link builder earns its keep

Marketing and support teams pin contact buttons to prefilled drafts so customers open the right mailbox with a ticket-shaped subject already set. Documentation sites and help centers generate per-page feedback links whose body includes the article URL and product version without hand-escaping every character. CMS migrations need a parse pass over legacy HTML to extract recipients and subjects into structured content models before rewriting anchors.

QA scripts round-trip encode then parse to assert that template variables expand into legal URIs before a release ships. Pair it with your own send pipeline if you need delivery; this capability stops at a correct mailto link and a faithful field breakdown of whatever you already have.

Prefill contact and support buttons

Generate mailto hrefs with a fixed support address, a product-specific subject, and an optional body template for help widgets and footer links.

Audit and migrate legacy mailto anchors

Parse existing mailto links in HTML exports to recover recipients, subjects, and bodies into structured CMS fields before rewriting pages.

Round-trip QA for email templates

Encode template variables into a mailto URI, parse it back, and assert subjects and bodies match so release checks catch encoding regressions.

How do I build a mailto link with subject and body?

Call with mode encode (or omit mode), set to to the recipient email, and pass optional subject, body, cc, and bcc. The response mailto field is the ready-to-use URI with percent-encoded headers.

What counts as an invalid email address?

Each address must look like local@domain.tld with no spaces or angle brackets. Lists may be comma-separated.

Does this send email?

No. It only builds or parses mailto links. Opening the link still depends on the visitor's mail client; delivery and SMTP are out of scope.

Why does an ampersand in the subject break a mailto link?

Because without encoding the ampersand looks like the start of the next header, so the subject is cut short there. The builder percent-encodes every value, so ampersands, question marks, spaces, accents and line breaks arrive intact.

Can I turn an existing mailto link back into separate parts?

Yes. The parse option splits a link into recipients, subject, body, cc and bcc, decoding each value. Unknown headers are ignored, and a link with no recipient anywhere is refused rather than returned half empty.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/enc/mailto-encode

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/enc/mailto-encode \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"mode":"encode","op":"encode"}'
{
  "mode": "encode",
  "op": "encode"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "enc.mailto_encode",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

A mailto link is the smallest bridge between a web page and the visitor's email client: one click opens a draft with the recipient already filled, and often a subject and body that match the call to action. Malformed schemes, invalid addresses, and broken percent sequences fail with invalid_input instead of half-decoded garbage. The same pure logic powers the free browser tool and the API path at $0.002 per successful call.

What a mailto URI carries and why encoding matters

Every value in that query string must be percent-encoded so reserved characters such as ampersands, equals signs, question marks, spaces, and non-ASCII letters survive copy-paste into HTML attributes, QR payloads, and chat messages. This capability applies encodeURIComponent-style encoding on the way out and a strict decode on the way in: each percent escape must be two hexadecimal digits, and incomplete sequences raise invalid_input rather than returning a silently truncated string.

Input contract, response shape, and error behaviour

Send mode equals encode (the default) with a required to field and optional subject, body, cc, and bcc strings. Parse mode fills the same field shape from the path and from known header names, ignores unknown headers for forward compatibility, and rejects links that have no recipient in the path or in to, cc, or bcc headers. Field length is capped so accidental multi-megabyte pastes cannot blow worker memory; keep subjects and bodies to ordinary email sizes and the analytic path stays sub-millisecond. On success the response echoes the structured fields that were non-empty, returns the full mailto string, counts how many query parameters were written, and sets boolean flags has_subject, has_body, has_cc, and has_bcc so clients can branch without re-parsing the URI. For mode equals parse, provide the mailto field (aliases link, url, uri, and href are accepted) containing a full mailto URI; the scheme is matched case-insensitively and surrounding whitespace is trimmed. Missing to on encode, a URI that does not start with mailto, invalid email tokens, and malformed percent sequences all fail with invalid_input and are not billed.

Can I parse an existing mailto URI?

Yes. Set mode to parse and pass the full string in mailto (or link/url/uri/href). The API returns to, subject, body, cc, and bcc when present, plus flags for which headers were found.

What does the mailto link builder cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →