mail to in html



  • Mailto is a HTML link that activate the default email application of the device to send mail to the link address.
  • The browser sent a request to the default email application for sending an email.

Syntax for mail to in html

<a href="mailto:abc@xyz.com">Text</a>

Parameters :

Value Description
mailto:abc@xyz.com Recipient email address
cc=abc@xyz.com carbon copy email address
bcc=abc@xyz.com blind carbon copy email address
subject= text subject of email
body= text body of email
? first parameter delimiter
& additional parameters delimiter

Sample coding for mailto in HTML

Tryit<!DOCTYPE html>
<html>
   <head>
        <title> Wikitechy mailto in HTML</title>
         <link rel="stylesheet" type="text/css" href="login-style.css">
   </head>
    <body>
         <h2>HTML5 mailto</h2>
         <a href="mailto:mail@email.com?subject=My Subject&cc=mycc@email.com
         &bcc=mybcc@email.com&body=My Body">Click here to Send Mail </a>
         </body>
</html>


Code Explanation for mailto in HTML

code explanation for mailto in HTML

  1. The mailto is used to create a link for send email option to mail@email.com.
  2. The subject is used to set the subject text of the email.
  3. The cc is used to set carbon copy email address as cc@email.com.
  4. The bcc is used to set blind carbon copy email address as bcc@email.com.
  5. The body is used to set the body text of the email.

Output for mailto in HTML

Output for mailto in HTML

  1. The “Click here to Send Mail” link displayed for sent mail to the specified address.
Output for mailto in HTML

  1. The To address has been set as mail@email.com.
  2. The Cc address has been set as mycc@email.com.
  3. The Bcc address has been set as mybcc@email.com.
  4. The Subject text has been set as My Subject.
  5. The Body text has been set as My Body.

Browser Support for mailto in HTML

Yes Yes Yes Yes Yes

Related Searches to mailto in html