Questions tagged [mailto]

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 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
& = &amp;               [ = %5B

8-bit characters in mailto URLs are forbidden.

More information

  • RFC 2368, which defines the mailto scheme.
1116 questions
26
votes
3 answers

mailto crontab doesn't work

I'm running a script on my mybookworld(NAS) via crontab every day. And it would be nice if it could send me everyday an email report with the output of the script. So I looked at MAILTO in crontabs, but it doesn't send me anything at all. The script…
Simon Lenz
  • 2,732
  • 5
  • 33
  • 39
26
votes
3 answers

How can I create mailto links without recipient that will work on Chrome on Ubuntu?

I have a mailto link in my HTML. The HREF is MAIL In other words, I am specifying body and subject, but not recipient. In Chrome on Ubuntu, clicking this produces an dialog with a error Unable to…
Joshua Fox
  • 18,704
  • 23
  • 87
  • 147
26
votes
6 answers

Is there a "map:" URI prefix to launch map application? (like mailto: or tel:)

Is there such prefix for launching map application on phones, Toto's home like can do Toto's mail
user1125394
24
votes
5 answers

How to send mail with a Subject using a Mailto URL?

I need to make a Mailto link to my website which is suppose to contain either the product name or the product page URL in the subject section. How can I do it? Exp: When you get an email through eBay about a product you are selling or buying, you…
Frank
23
votes
2 answers

Styling email link / href="mailto:" with CSS

Thanks to StackOverflow I finally found a way to style my email link, but I wonder why it doesn't work without the solution I found on here. Since the link is part of the span with the attributed class "about", which has font size and style defined,…
Roland
  • 1,908
  • 4
  • 21
  • 34
21
votes
9 answers

mailto link (in chrome) is triggering window.onbeforeunload - can i prevent this?

Possibly related to How to open mailto link in Chrome with Window.open without creating a new tab? Hi all. I have a form page where i've put a window.onbeforeunload confirm, to stop people navigating away and losing their changes by…
Max Williams
  • 32,435
  • 31
  • 130
  • 197
21
votes
8 answers

mailto links in Gmail

I've encountered a problem with Gmail's web application. For some reason, the mailto links doesn't work when I try to add the body into the link. The links works fine as long as the & separator for the body is not used. For…
sagibb
  • 956
  • 2
  • 9
  • 21
21
votes
4 answers

mailto: link in UIWebView - Does Not work

Is the areanything special you need in html or Callbacks in a UIWebView to handle anchor tags with an href, or is there something special about an anchor tag with a mailto link in the href?
Sean McCully
  • 1,122
  • 3
  • 12
  • 21
20
votes
3 answers

Gmail signature not working on mailto link

When I use Gmail to send an email, the email signature defined in the settings is automatically added at the bottom of the email. However, when I open a mailto link to send a message, the email signature is not automatically added. Here's the…
frenchie
  • 51,731
  • 109
  • 304
  • 510
20
votes
2 answers

Line break in the mailto onclick

The code below works great except the email has all the text on one line like this: Height: 60 | Diagonal: 123 | Width: 107 | Total SF: 13.92 | Cost Per SF: 450 | Total Cost: $6,264.00 I would like to break after each so it looks like this: …
malaki1974
  • 1,605
  • 3
  • 16
  • 32
19
votes
10 answers

mailto special characters

Is there a way to make the email client ( Outlook ) accept special characters coming from the mailto link in html? I'm trying to have a mailto link with german characters in the body, but in Outlook I get only strange characters. Thanks
Bogdan S
19
votes
1 answer

Is it possible to modify "from" field in mailto link?

I'm trying to get a mailto link that would open a new outlook email window with a modified from field (i.e. to use a secondary account as it were). Is that possible?
Ilia Draznin
  • 1,026
  • 2
  • 12
  • 24
19
votes
15 answers
19
votes
4 answers

What is the format of compose links to web mail clients such as Gmail, Yahoo Mail, Hotmail and AOL?

In my application, I'm currently using mailto: links to open email compose dialogs. This is terrible for web mail users, since it typically causes Outlook or Apple Mail to launch into their setup wizard. Until I've implemented a separate compose…
nickbaum
  • 583
  • 4
  • 11
18
votes
10 answers

How to disable an email link?

I am using Ruby on Rails 3 and I would like to disable an email address link in a HTML email. For example, if in an email I send some raw HTML like Hi, you email is:
test@email.com Gmail autodetects that this is an email address and changes…
user502052
  • 14,803
  • 30
  • 109
  • 188
1 2
3
74 75