Are you looking to send an email with a predefined subject line directly from your web page? The HTML "mailto" attribute allows you to create such a link. Let's delve into the world of HTML email links and explore the power of the "mailto" attribute, particularly how to set a subject using it.

In this guide, we'll walk you through the basics of creating HTML email links with a predetermined subject, as well as advanced topics like encoding special characters and sending emails with multiple recipients or CCs.

The Basics of HTML Email Links with "mailto"
Before we dive into advanced topics, let's first understand how to create a simple HTML email link with a specified subject.

The "mailto" attribute is a URL scheme that enables user agents (like web browsers) to launch the user's default email client. The basic syntax to create an HTML email link is as follows:
```html Send Email ```
Setting a Subject using the "subject" Parameter

To set a subject for your email, you can use the "subject" parameter in the "mailto" attribute. The syntax for this is:
```html Send Email ```
Note that special characters and spaces in the subject need to be encoded using URL encoding. In the example above, spaces are replaced with "%20".
Sending Emails to Multiple Recipients

You can send emails to multiple recipients by separating their email addresses with commas:
```html Send Email ```
However, if you want to add CC recipients, you'll need to use the "cc" parameter:
Advanced HTML Email Links with "mailto"

HTML email links offer a wide range of functionalities. Let's explore a few more advanced features.
For instance, you can pre-fill the body of the email with the "body" parameter:




















Pre-filling the Email Body
To pre-fill the email body with a message, use the "body" parameter:
```html Send Email ```
Encoding Special Characters and Spaces
As mentioned earlier, spaces and special characters in the mailto parameters need to be encoded using URL encoding. But what if you want to include special characters like "@"?
The trick is to encode Holland, using "%40". So, instead of "example@domain.com", you should use "example%40domain.com".
This concludes our guide on creating HTML email links with the "mailto" attribute, including setting a subject, sending emails to multiple recipients, and pre-filling the body with a message.
However, always remember that while the "mailto" attribute provides a convenient way to initiate emails from a web page, it's not a guaranteed method. The user's device, operating system, and default email client all play a role in whether the email is actually sent.
Happy coding, and don't forget to explore more HTML and email-related topics on W3Schools!