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

What is mailto´s URL on a webpage

if you have a email address on the webpage - mailto: then - is it possible to activate the mailto directly via URL - for example http://www.homepage.com/mailto:email@email.com URL and if putting the url directly into the browser then the mailto…
Toomas Neli
  • 301
  • 1
  • 4
  • 13
-2
votes
2 answers

Mailto: inside php and html table

I'm populating an html table with data from MySQL DB and I want to add a mailto function on the click of one of the columns. Problem is when I do it, the column is blank, but when I inspect it in the browser it shows up in the inspect panel. My…
Mwikala Kangwa
  • 430
  • 7
  • 24
-2
votes
2 answers

Use javascript to replace input value into mailto

I have to email some information and I can't use PHP unfortunately. I've set up an input to get the email address of a user.
Nick0989
  • 459
  • 5
  • 15
-2
votes
1 answer

rails: how to let user send a html email

I want to let the user of my page send a html formated email to friends. Is this possible?
Markus
  • 3,948
  • 8
  • 48
  • 64
-2
votes
1 answer

What is "mailto:someone@example.com" in following HTML form example?

I am learning HTML from w3schools HTML Tutorial - The Best in Class Tutorial I come across one HTML form example which sends an email. Please note that currently neither do I nor w3schools is going for server side input processing, so you also don't…
PHPLover
  • 1
  • 51
  • 158
  • 311
-2
votes
3 answers

mailto: URL not working in jQuery bound event handler

I have an icon that when clicked will fire off a mailto: URL. Seems simple enough, but it's not working. When debugging I click the icon and the event handler does fire and executes the code within it, but then does nothing. Why doesn't this…
razaross444
  • 513
  • 4
  • 15
-2
votes
1 answer

How to add attachment to a mailto from my custom html/css contact form?

I've created a simple contact form with inputs like name, phone number.. And a file import (in order to add an attachment to the mail). All the informations are shown in the mail except the imported file. How to make it works please ?? a{ …
Sushi
  • 646
  • 1
  • 13
  • 31
-2
votes
2 answers

I need to create a mailto link from PHP code

Ok, so at the moment my html form gathers data and posts it to a php form which then creates and sends an email (following code), however now I need the form to create a mailto link so I can send it to a different mail account from my iphone6, any…
Davey H
  • 13
  • 1
  • 3
-2
votes
1 answer

Mailto form for idea

I am wanting to use a mailto form like the one below Name:

E-mail:
-2
votes
1 answer

Im looking for a simple mailto button

Im looking for a mailto button that will have a built in message that is emailed to a preset email address. eg: You see a button that says confirm when you click that button it sends an email message directly from the browser to the email address…
Brandon
  • 103
  • 1
  • 1
  • 7
-2
votes
1 answer

mail to in an existing php code

i have this code: if($this->helix3->getParam('contact_email')) $output .= '
  • ' . $this->helix3->getParam('contact_email') . '
  • '; $output .= '
      '; return $output; I…
    -2
    votes
    2 answers

    Java get email address from url

    I have this url mailto:email@gmail.com?subject=... and I want to extract the email address. I've done this: String[] s = url.split("[:?]"); It works but I'm not happy with this solution. Is there a way to do this using a regular expression or…
    Ale
    • 2,282
    • 5
    • 38
    • 67
    -2
    votes
    3 answers

    mailto link overflowing from image link

    I have a website set up at http://jamesfrewin.co and I have tried to make the small envelope icon have the link for mailto work just on the envelope image but it seems to be overflowing to the whole box. Any help to sort this out would be greatly…
    user1888478
    • 101
    • 1
    • 10
    -2
    votes
    3 answers

    How to use the Mailto function in PHP

    I am really new at all of this and need help... I have a forum I am trying to send, but for some reason it is not sending. The mailto function is not sending an email on the server, and it is also not refreshing to redirect.html. Here is my code: …
    Pixel Reaper
    • 265
    • 5
    • 17
    -2
    votes
    1 answer

    mailto in PHP without a button click

    Is there a way to cause an action similar to clicking a mailto link from withing PHP? I would like it to use the local email client (e.g., outlook) to build and send several emails within a PHP controller. Then manually send each one thorough the…
    Haymps
    • 91
    • 9
    1 2 3
    74
    75