Table of Contents
Mailto links are links that directly link to an email address. This will open the user's default email client and fill in the email address provided in the link automatically.
To create a mailto link, add a href
attribute to the a
tag with the mailto
prefix, and then the email address you want to link to.
HTML<a href="mailto:[email protected]">Send Email</a>
You can add more than one email address by separating them with commas:
HTML<a href="mailto:[email protected], [email protected]">Send Email</a>
Mailto links support more than just the email address field. You can also add these fields:
subject
: The subject of the emailbody
: The body of the emailcc
: A comma-separated list of email addresses to CCbcc
: A comma-separated list of email addresses to BCC
Here's how to automatically fill in the subject to Hello World!
:
HTML<a href="mailto:[email protected]?subject=Hello World!">Send Email</a>
To add emails to CC and BCC, add the cc
and bcc
fields to the mailto
link:
HTML<a href="mailto:[email protected][email protected], &[email protected]">Send Email</a>
To add a body to the email, add the body
field to the mailto
link:
HTML<a href="mailto:[email protected]?body=Hello World!">Send Email</a>
Conclusion
Mailto links are a great way to make it easier for your users to send emails to you. With the power to set the email address, subject, body, CC, and BCC, you can create a link that opens the user's default email client and fills in exactly the information you want filled in.
- Managing PHP Dependencies with Composer
- Getting Started with Svelte
- Getting Started with Electron
- Git Tutorial: Learn how to use Version Control
- Best Visual Studio Code Extensions for 2022
- How to deploy a Deno app using Docker
- Using Puppeteer and Jest for End-to-End Testing
- How to Scrape the Web using Node.js and Puppeteer
- Using Push.js to Display Web Browser Notifications
- Building a Real-Time Note-Taking App with Vue and Firebase
- Getting Started with React
- Using Axios to Pull Data from a REST API