It would be difficult to find anyone who works online that hasn’t interacted with the HTML mailto link. When you click on it, this link activates the default email client on a user's computer to send an email. It is used inside an anchor tag with a href attribute. In this article, we will discuss:
What is a Mailto Link in HTML?
Mailto links are used to redirect the user to an email address instead of a link. When the user clicks on a mailto link, the default email client opens on the user’s computer and suggests sending an email to the address included in the mailto link.
Want a Top Software Development Job? Start Here!
Full Stack Developer - MERN StackExplore Program
How to Create Mailto Links in HTML?
You can create an HTML mailto link by using an anchor tag with the href attribute and inserting the “mailto” parameter after it.
The code will generate the following link:
Clicking on the link above will open a new mail window:
If you want to send an email to more than one address, separate your email address with a comma.
Want a Top Software Development Job? Start Here!
Full Stack Developer - MERN StackExplore Program
Mailto Parameters
The mailto attribute accepts seven parameters, as described below:
- mailto: This parameter specifies the email address of the recipient.
- cc: This parameter is used to add another email address that will receive the mail's carbon copy. It is optional.
- bcc: This parameter specifies another email that will receive the blind carbon copy of the mail. It is optional.
- subject: This parameter is used to fill the subject of the mail. It is optional.
- body: This parameter is used to fill the content of the mail. It is optional.
- ?: This parameter is the first parameter delimiter. It is optional.
- @: This holds the other parameter delimiter. It is optional.
Want a Top Software Development Job? Start Here!
Full Stack Developer - MERN StackExplore Program
You may be wondering how you can obtain the skills necessary to take advantage of HTML’s immense popularity, and how you can go beyond just learning about the HTML mailto attribute. You can enroll in a comprehensive Full Stack Java Developer course to help you become career-ready upon completion. To learn more, check out our YouTube video that provides a quick introduction to HTML and explains how to write a simple ‘Hello World’ program in HTML.
If you’re an aspiring web and mobile developer, HTML training will broaden your skills and career opportunities. Do you have any questions for us? Please ask them in the comments section, and we'll have our experts answer them for you.
Want a Top Software Development Job? Start Here!
Full Stack Developer - MERN StackExplore Program