Mailto is the URI scheme for email addresses. It is used in web pages as a link that opens a new email message to the specified to-address in the user's default email client.
Mailto is the URI scheme that targets the user's client from within the browser. Clicking a mailto link creates a new email message in the user's email client, optionally with to, cc, subject, and body pre-populated.
A mailto link can be inserted into a webpage using a standard anchor link:
The simplest mailto link specifying a recipient addresses..
<a href='mailto:someone@host.com'>Click to email</a>
Multiple recipients..
<a href='mailto:nobody@host.com,nowhere@host.com'>Click to email</a>
Autofill the subject line..
<a href='mailto:someone@host.com?subject=This%20is%20the%20subject'>Click to email</a>
Autofill the subject line and specify the email to be CC'd to..
<a href='mailto:someone@host.com?cc=me@me.com&subject=Testing%20mailto&'>Click to email</a>
Mailto 3 people, with a BCC and a subject..
<a href='mailto:someone@yoursite.com?cc=someoneelse@theirsite.com, another@thatsite.com, me@mysite.com&bcc=lastperson@theirsite.com&subject=Big%20News'>Click to email</a>
Autofill the subject line and body of the email with a linebreak..
<a href='mailto:someone@host.com?subject=Readme&body=This%20is%20the%20first%20line%0D%0AThis%20is%20the%20second'>Click to email</a>
Add a reply-to address..
<a href='mailto:someone@host.com?reply-to=me@me.com'>Click to email</a>
Special Character escaping
Within mailto URLs, the characters "?", "=", "&" are reserved.
Special characters that appear in addresses, headers or message contents must be encoded using a "%" followed by a two-digit hex number. See RFC3986 for a exhaustive description of URL encodings.
Space = %20 : = %3A ] = %5D
Line Break = %0D%0A ; = %3B { = %7B
" = %22 ' = %27 } = %7D
# = %23 < = %3C \ = %5C
$ = %24 > = %3E | = %7C
% = %25 / = %2F = = %3D
^ = %5E ? = %3F
& = & [ = %5B
8-bit characters in mailto URLs are forbidden.
More information
- RFC 2368, which defines the mailto scheme.