Problem Statement
How do you create an email link in HTML?
Explanation
To create an email link in HTML, you use the anchor tag with href equals mailto colon followed by the email address. When users click this link, their default email client opens with a new message addressed to the specified email. You can enhance mailto links by adding additional parameters. For example, you can pre-fill the subject line using question mark subject equals your subject. You can also pre-fill the body text using ampersand body equals your message. You can add CC or BCC recipients as well. Email links are useful for contact pages, but be aware that they require users to have an email client configured. Some users may prefer a contact form instead.
Code Solution
SolutionRead Only
<!-- Basic email link --> <a href="mailto:info@example.com">Email Us</a> <!-- With subject line --> <a href="mailto:support@example.com?subject=Help Request">Get Help</a> <!-- With subject and body --> <a href="mailto:sales@example.com?subject=Product Inquiry&body=I am interested in...">Contact Sales</a> <!-- With CC and BCC --> <a href="mailto:info@example.com?cc=manager@example.com&bcc=admin@example.com">Email with CC</a>
