Jomatter

How to Link an Email in HTML?

To link an email address in HTML, use an <a> anchor tag with a mailto: URL in the href attribute. When a visitor clicks the link, the browser passes the address to the device’s configured email application or mail handler.

The basic syntax is:

<a href="mailto:[email protected]">[email protected]</a>

This is the standard HTML method for creating a clickable email link.

Basic HTML Email Link

The simplest version contains only the email address:

<a href="mailto:[email protected]">Email us</a>

You can use the actual email address as the visible text:

<a href="mailto:[email protected]">[email protected]</a>

The important part is mailto:. Do not use https:// for a normal email link. https:// creates a web link, while mailto: tells the browser that the destination is an email address.

Add a Subject to the Email

You can prefill the subject by adding a subject parameter after the email address:

<a href="mailto:[email protected]?subject=Website%20Inquiry">
  Email Us
</a>

The value after subject= is URL-encoded. A space is represented as %20.

For example, this opens a new email with:

You can also write the subject directly when characters do not require encoding, but URL encoding is the safer and more reliable approach when the subject contains spaces or special characters.

Add a Prewritten Email Body

A body parameter lets you place default text in the email:

<a href="mailto:[email protected]?subject=Website%20Inquiry&amp;body=Hello%2C%20I%20would%20like%20more%20information.">
  Send an Inquiry
</a>

In HTML source, use &amp; between query parameters. The browser interprets it as & in the URL.

The example above can open an email containing:

Subject: Website Inquiry

Hello, I would like more information.

For line breaks, URL-encode them as %0A:

<a href="mailto:[email protected]?subject=Support%20Request&amp;body=Hello%2C%0AI%20need%20help%20with%20my%20account.">
  Contact Support
</a>

Add CC and BCC

You can also specify additional recipients with cc and bcc:

<a href="mailto:[email protected][email protected]&amp;[email protected]">
  Email the Team
</a>

Multiple recipients are separated with commas:

<a href="mailto:[email protected][email protected],[email protected]">
  Contact Us
</a>

For more than one parameter, separate them with &, written as &amp; in HTML source.

The Complete Example

A practical email link can include the recipient, subject, and body together:

<a href="mailto:[email protected]?subject=Support%20Request&amp;body=Hello%2C%0AI%20need%20help%20with%20the%20following%20issue%3A%0A">
  Contact Support
</a>

This gives the user a ready-to-edit email instead of making them type the recipient and subject manually.

Important: mailto: Does Not Send the Email

A mailto: link does not send an email directly from your website. It opens the email application or mail handler configured on the visitor’s device or browser.

That means the result depends on the user’s environment. A visitor may have a desktop email client configured, a browser-based mail handler, or no working email handler at all.

If you need a guaranteed web-based contact process, use a contact form connected to your website or an email service instead of relying only on mailto:.

Common Mistakes

The most common mistake is forgetting mailto::

<a href="[email protected]">Email</a>

This is not a correct email link. The correct version is:

<a href="mailto:[email protected]">Email</a>

Another mistake is writing spaces and special characters directly into complex query parameters. Encode them properly, especially when using subject, body, line breaks, or punctuation.

Also remember that the visible link text and the destination are separate. This is valid:

<a href="mailto:[email protected]">Contact our team</a>

The user sees “Contact our team,” while the click opens an email addressed to [email protected].

When to Use an Email Link

Use a mailto: link when you want a visitor to contact a known email address from a webpage with one click. It works well for simple contact links, sales inquiries, support addresses, author contact links, and other situations where the visitor is expected to write the message in an email application.

For a website’s main contact process, a form is often more appropriate when you need required fields, spam protection, file attachments, confirmation messages, or server-side processing. The correct choice depends on whether you need to open the visitor’s email client or collect the message through your website.

Final HTML Pattern

For most websites, this pattern covers the requirement:

<a href="mailto:[email protected]?subject=Website%20Inquiry&amp;body=Hello%2C%0AI%20would%20like%20more%20information.">
  Contact Us
</a>

Use mailto: for simple email links, URL-encode subject and body values, and use &amp; between multiple parameters in HTML. If your website needs form validation, guaranteed delivery, file uploads, or server-side email handling, use a contact form instead.

More Guide On HTML

How To Integrate WordPress Blog Into Html Website
How To Link A Css File To An Html File
How To Make More Than One Page In Html
How To Put An Image Beside Text In Html
How To Put Text Under An Image In Html
How To Write A Paragraph In Html
What Is The Purpose Of Html In Web Development
Which Of The Following Are Examples Of Html Objects
How To Convert Html To WordPress