Khalil Ghâñmî

0 %
Khalil Ghâñmî
Développeur full-stack
  • Residence:
  • City:
  • Age:
  • HTML 5 / CSS 3
  • Bootstrap
  • JavaScript / Jquery/Ajax
  • ReactJS
  • API
  • Angular
  • PHP/Mysql
  • Python
  • Java
  • Wordpress
  • OpenCart
  • Illustrator | Photoshop | Premier Pro | Animate
  • OVH | Godaddy | Vipdomaine | Zenhosting | LWS | Hostgator
  • Cpanel
  • Google Search | Google sheets | Google docs | Office

The mailto command

24 August 2022

In HTML, the mailto: command allows you to request the Internet user’s email from a Web page. You can therefore place it on your site to allow your visitors to send you an e-mail.


  • Very simple to install
  • Possibility to fill in by default certain fields such as the subject and the recipients in copy

The inconvenients

Generally poses a problem for Internet users using webmail: users of these services may have to type or copy your e-mail address to write to you.
Fairly limited message personalization.

How do I link to an email address?

Pour appeler une messagerie depuis une page Web, il suffit de créer un lien (comme d’habitude avec la balise <A HREF= »… »>) dans le code de la page puis d’utiliser l’instruction mailto:.

Ce qui donne par exemple, pour écrire à l’adresse :

<a href="">ici</a>

An example ? Click here !

If you wish to place several recipients, all you have to do is place the addresses one after the other, simply separated by commas (without spaces).

How to impose the subject of the message or the recipients of the copies?

It is possible with mailto: to fill in some default fields, such as the subject of the email or the recipients of the copies.

Imposing the subject of the email

Look: you will send an email to with the subject “Hello”. Click here! So what code should I use? Here it is :

<a href="">ici</a>

Warning: use the character string %20 instead of the space and %27 instead of the apostrophe.

Set copy recipients

You can even impose recipients of carbon copies (Cc:) and blind copies (Bcc:). Click here for an example! The code this time is:

<a href="

Fill in the message

You can still fill in the first line of the email. Click here for an example. The code this time is:

<a href=" premiere ligne du message">ici</a>

Again, use the string %20 instead of the space and %27 instead of the apostrophe.

Protect your address on your own site

When you publish, through a mailto: link, your e-mail address on your website, you are likely to see it taken by address bots and to receive many unsolicited e-mails.

Posted in html, Non classé, WebTags:
Write a comment