Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4791 pages

Free tool · Developer tools

Mailto link generator

This mailto link generator builds a link that opens a new email with the recipient, subject and message already filled in. The sample below gives a 199 character link, with every special character in the subject and message encoded, plus the HTML to paste.

  • Free
  • No sign-up
  • Runs in your browser

By Maaz Zindani · Updated

Mailto link

Link ready2 recipients, 199 characters

mailto:support@example.com?cc=billing@example.com&subject=Order%20%234821%3A%20question%20about%20delivery&body=Hi%2C%0D%0ACould%20you%20confirm%20the%20delivery%20date%3F%0D%0AThanks%20%26%20regards
HTML to paste into a page
<a href="mailto:support@example.com?cc=billing@example.com&amp;subject=Order%20%234821%3A%20question%20about%20delivery&amp;body=Hi%2C%0D%0ACould%20you%20confirm%20the%20delivery%20date%3F%0D%0AThanks%20%26%20regards">Email support</a>
    Recipients
    2
    Link length
    199 characters
    Percent escapes
    20
    How each part was written
    PartIn the link
    Tosupport@example.com
    ccbilling@example.com
    subjectOrder%20%234821%3A%20question%20about%20delivery
    bodyHi%2C%0D%0ACould%20you%20confirm%20the%20delivery%20date%3F%0D%0AThanks%20%26%20regards

    How to use the Mailto Link Generator

    1. Type the address in To. Add more addresses with commas, and fill Cc or Bcc if you need them.
    2. Write the Subject and the Message. Line breaks in the message are kept.
    3. Set the Link text that readers will see on your page.
    4. Press Copy link for the bare link or Copy HTML for a ready anchor, and try it with Open in my mail app.

    How do you make a mailto link with a subject and body?

    A mailto link is the word mailto, a colon and the address, followed by a question mark and fields joined with ampersands: mailto:address?subject=...&body=.... The rules come from RFC 6068. The only work is to encode the text of each field so that spaces, ampersands, hashes and other special characters do not break the link.

    The sample uses the subject "Order #4821: question about delivery". The hash and the colon are special, so the subject is written as Order%20%234821%3A%20question%20about%20delivery. The message has three lines and an ampersand, and the finished link is mailto:support@example.com?cc=billing@example.com&subject=Order%20%234821%3A%20question%20about%20delivery&body=Hi%2C%0D%0ACould%20you%20confirm%20the%20delivery%20date%3F%0D%0AThanks%20%26%20regards.

    Only fields that have content are added, in the order cc, bcc, subject and body. A link with an address alone is just mailto: and the address. With no recipient at all the link starts with mailto: and a question mark, which opens a blank message that the sender addresses.

    How each part of the sample link was written
    PartIn the link
    Tosupport@example.com
    ccbilling@example.com
    subjectOrder%20%234821%3A%20question%20about%20delivery
    bodyHi%2C%0D%0ACould%20you%20confirm%20the%20delivery%20date%3F%0D%0AThanks%20%26%20regards

    How do you add cc, bcc and several recipients?

    Several addresses go in one list separated by commas, and commas stay as plain commas inside the link. Entering ana@example.com and ben@example.com with the subject Notes gives mailto:ana@example.com,ben@example.com?subject=Notes. The tool also accepts semicolons and new lines between addresses and turns them into commas.

    Cc and Bcc are header fields, written as cc=... and bcc=... after the question mark. mailto:ana@example.com?bcc=audit@example.com&subject=Notes shows a Bcc. A Bcc address sits in the link text, so anyone who views the page source can read it. RFC 6068 warns about this and about address harvesters. The tool adds a note when a Bcc is present.

    RFC 6068 names Subject, Keywords and Body as the header fields that are generally safe, and tells mail apps to ignore several others. An app may therefore drop Cc or Bcc from a link. Test the link in the mail apps your readers use before you rely on them.

    Which characters must be encoded, and how do line breaks work?

    Everything except letters, digits and a few marks such as the hyphen, the period and the tilde is written as a percent sign and two hexadecimal digits, using UTF-8 for non-English letters. The question mark, equals sign and ampersand have jobs inside a link, so they must be encoded when they are part of your text. A literal percent sign is written %25, and it must be encoded once only, because encoding it twice turns %20 into %2520.

    A line break in the message is written %0D%0A, a carriage return plus a line feed, so one%0D%0Atwo is the message "one" and "two" on two lines. Spaces are %20 and not a plus sign. RFC 6068 explains why: a plus in an address, as in ana+news@example.com, would be read as a space by software that treats pluses that way. This tool writes a plus as %2B, so that address becomes ana%2Bnews@example.com.

    Characters and how the tool writes them
    CharacterYou typeIn the link
    Spacespace%20
    Ampersand&%26
    Equals sign=%3D
    Question mark?%3F
    Hash#%23
    Percent sign%%25
    Plus sign+%2B
    Line breaknew line%0D%0A
    Accented letteré%C3%A9
    Comma,%2C

    How do you use a mailto link in HTML, or with a non-English domain?

    In HTML the link goes in the href attribute of an anchor, and every ampersand inside it must be written &amp;. The HTML box does that for you and escapes the link text too, so the anchor is ready to paste. The text between the tags is what people see, so use words such as "Email support" rather than a bare address if you want to avoid showing it twice.

    RFC 6068 asks that a domain with non-English letters be written in its xn-- form. The tool converts the domain label by label, so user@納豆.example.org becomes user@xn--99zt52a.example.org. Letters outside ASCII in the part before the @ are percent-encoded as UTF-8.

    An address must have the form name@domain with no spaces, angle brackets or quotes. Anything else stops the link with a message that names the entry.

    Use it with

    Questions

    What is the format of a mailto link?

    mailto:address?subject=...&body=... where every field value is percent-encoded. The sample link is mailto:support@example.com?cc=billing@example.com&subject=Order%20%234... and continues with the encoded message.

    How do I put a line break in the body of a mailto link?

    Write it as %0D%0A. Typing a new line in the Message box does this for you.

    How do I send a mailto link to several people?

    Separate the addresses with commas after mailto:, as in mailto:ana@example.com,ben@example.com.

    Can I include a Bcc in a mailto link?

    Yes, with bcc=address after the question mark, but the address is readable in the page source and some mail apps ignore it. RFC 6068 lists Subject, Keywords and Body as the generally safe fields.

    Why do I need %20 instead of spaces?

    A link cannot contain a raw space. %20 is the standard way to write it, and a plus sign is not a space in a mailto link.

    Is my message sent anywhere when I use this tool?

    No. The link is built in this page and nothing you type is sent to a server. Pressing Open in my mail app hands the link to your own mail program.

    Sources

    The tool's results are computed in your browser by the code on this page, using the sources listed above; the explanations are checked against the tool's own output.