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
-2
votes
3 answers

How to remove window.alert pop up?

Here is some script I copied to create a mailto link which grabs the browser URL and inserts it into the subject of the email. Its working perfect but every page I go to a Javascript alert box pops up saying: mailto:address@address.ca?Subject="WHAT…
Andrew John
  • 153
  • 2
  • 3
  • 14
-3
votes
2 answers

Is there a method in PHP to get the default email of a user?

Is there a PHP method to fetch the default email of a user? same effect if you would use mailto: Example scenario: If you use mailto:some@email.com to open mail client it would automatically fill in the "From" field of the form with the user's…
Pennf0lio
  • 3,888
  • 8
  • 46
  • 70
-3
votes
1 answer

How to open Outbox/Sent-Emails in default email client, from Javascript on button click?

On the click of a button, I want to show the user what emails have been sent (by another program/module which does automatic email based reporting when certain criteria are met) by my program while he was away. So I have thought that a good way…
Shy
  • 542
  • 8
  • 20
-3
votes
1 answer

a valid alternative to mailto?

I maintain a site for an organization that contains 80+ contacts. when I created this site I used mailto: to allow people to contact the required individual, which worked fine until just recently. Now I find that when I click on the email link…
rhubarb67
  • 11
  • 1
  • 4
-4
votes
1 answer

How can I send an email address and current url

How can I send the current URL to specific email address. Tried this but it's opening two emails:
-8
votes
2 answers

Would you suggest the "mailto" way if there's no knowledge of "PHP coding?

I'm in hurry to upload the template that I already edited and have no time to learn PHP. Do you suggest the link below as a "temporary way" of displaying my contact info till the day I learn PHP coding? A code like this link?
Tumaj Nuri
  • 37
  • 7
1 2 3
74
75