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

what should I use to create a web contact form?

Hi guys this is my first question on stackoverflow. I'm an amateur web designer designing a mostly static website..I need to create a contact form for user queries.What's the best approach for this task? 1)php's mailto function? 2)form data stored…
-1
votes
1 answer

What is a "low-tech" way to send an email from a website?

I am creating a form that users will use to register for an event. However, I just discovered that there are some really tight security limitations due to policies due to the site's hosting and also policies the organization has about…
brentonstrine
  • 21,694
  • 25
  • 74
  • 120
-1
votes
6 answers

Mailto Script in php

I am new to Php and I want to know how mailto script works in php? Can anyone please provide a script for that?
sharath
  • 1
  • 1
-1
votes
2 answers

Simple mailing form with check boxes

Venerable masters of all things code, I am a simple graphic (not even web) designer, struggling to creating a working mailing script. So far, I managed to do it with basic HTML and a mailto function, but it needs to happen server-side, so, I am…
-1
votes
3 answers

How to add page URL in HTML mailto: subject and body.?

How to add page URL in HTML mailto: subject and body. Even some dynamic variable values need to be added. Thanks in advance
KrankyCode
  • 441
  • 1
  • 8
  • 24
-1
votes
1 answer

How come using mailto link with escaped characters is not recognized by yahoo mail?

I created an html page that has a mailto link. The body of the email has escaped characters (\', \", \n, \r) none of which seem to be recognized by Yahoo Mail (when yahoo mail is set to my default email). The mailto link parses the copy in the body…
-1
votes
2 answers

can we override outlook sender name in html email?

I have an html email newsletter sent monthly to customers. I've added a forward to friend link in the layout having href="mailto:%20?subject=SUBJECT &body=TEXT"> Now when I click the button, it opens "outlook new Email" page. When I send the email…
user1395625
  • 25
  • 1
  • 8
-1
votes
1 answer

I can't open the mailer with body too long in vaadin

Sorry for my english My problem is this, I open the manager OS Prefinished mails and charge information in the body. For that use the MailTo html and body SETTING but if the body is very long URL exceeds the limit and I do not open anything. Any…
-2
votes
4 answers

Using href=mailto link from an image in Javascript

I made a homepage. If you click anywhere the background needed to be changed, except if you click in to the picture with contact. If you click in that picture with contact, a mail should send for an email-address. Now everything is working, the only…
Koli
  • 197
  • 2
  • 16
-2
votes
2 answers

How to submit a form using mailto in form action?

I have an error when I try to submit my form, I have a message who say something like "ce formulaire n'est pas sécurise. la saisie automatique a été désactivée." My goal is when the user submit the form, you have the email windows with all the…
Imrickjames
  • 129
  • 9
-2
votes
1 answer

How to add CSS to mailto via javascript

I have this mailto script envoke via javascript. How can you add CSS? window.open('mailto:user@example.com?body=test');
jmariano
  • 11
  • 3
-2
votes
2 answers

Include Timestamp in mailto: subject

I want to include a timestamp in the subject of a mail. I already found out that I have to use javascript for this, I also found a way to include it, but I have trouble displaying the mail adress on the webpage (nothing is displayed). Below is the…
Cyhiraeth
  • 15
  • 1
  • 6
-2
votes
1 answer

How to copy / clone content of a page in href mailto

when a user clicks on the mailto: link the content of the page should be copied in his e-mail message-field. Where I put the code for that in Wordpress. I am not a coder. So please tell me the necessary steps to accomplish this. Thank you very much
Oliver
  • 1
  • 1
-2
votes
1 answer

can we get a call back by using mailto function in php to hide the button and check mail has been sent?

can we get a call back by using mailto function in php to hide the button and check mail has been sent?? My email button This mailto function opens up native mailbox, so is there any way to receive call back from it? I need to hide this link after…
-2
votes
3 answers

Using mailto (html) opens a tab with chrome

I am working on a website to have it be able to use mailto without typing out the email in the script. here is the function