![]() |
VOOZH | about |
The mailto link in HTML allows users to easily send emails by opening their default email application when clicked. It can include important details like the recipient’s email address, subject line, body, and optional fields such as CC and BCC, making it convenient for direct communication or feedback forms on websites.
A mailto link is an HTML feature that enables direct email composition through an anchor tag or form. It pre-populates fields like To, CC, BCC, subject, and body, simplifying the process of sending emails directly from a webpage.
<a href="mailto:name@email.com">Send an Email</a>For Forms:
<form method="POST" action="mailto:name@email.com" enctype="multipart/form-data">
<!-- Form content goes here -->
</form>Below are the approaches to create or use Mailto links in HTML:
Table of Content
Here's a brief description of the parameters used in a mailto link and their functions:
| Parameter | Description |
|---|---|
| mailto | Specifies the email recipient's address. This is the main parameter. |
| cc | Optional: Adds additional email addresses to receive a carbon copy (CC) of the mail. |
| bcc | Optional: Adds email addresses to receive a blind carbon copy (BCC) of the mail. |
| subject | Optional: Pre-defines the subject of the email. |
| body | Optional: Pre-fills the body content of the email. |
| ? | Acts as the first parameter delimiter to separate the mailto: and other parameters. |
| & | Acts as the delimiter to separate multiple parameters (like cc, bcc, etc.). |
@ | This holds the other parameters |
Here are two basic examples of how to use mailto in HTML:
Form Submission with Mailto Link allows users to send email directly from a web page. Parameters like recipient, subject, and body can be predefined in the link, facilitating quick email submission without server-side processing.
Example: The below examples illustrate the use of mailto links in HTML Form.
Output:
Direct Mailto Link with Parameters allows defining recipient, subject, and body of an email directly in an HTML link. This enables users to compose and send emails by clicking the link without requiring a mail client.
Example: This example illustrates the use of a mailto link to submit the feedback form through the mail in HTML.
Output: