How to Code an Email Link in HTML (And FREE Generator Tool)
If you’ve ever needed to link an email address in your website code, you’ve probably seen the basic mailto: format. It works, but there’s a lot more you can do with it—like pre-fill subject lines, add CC/BCC fields, or even obfuscate the email to avoid spam.
Let’s walk through how to write one by hand, and then how to do it the easy way using my Email Link HTML Generator tool and make it easy.
How to Code an Email Link in HTML
Here’s the bare minimum:
<a href="mailto:someone@example.com">Email Me</a>That opens the user’s default email app and starts a new message. But you can customize it further:
<a href="mailto:someone@example.com?subject=Hello&body=Just%20saying%20hi">Email Me</a>How Do I Hyperlink an Email Address?
Just use an <a> tag with mailto: instead of http:. Everything else works the same. Here’s the full breakdown:
mailto:starts the link- You can add parameters:
subject=,body=,cc=,bcc= - Separate them with
&
Mailto Link Generator
If typing this stuff out sounds like a pain (or you don’t want to mess up the encoding), you can just use my free HTML Email Link Generator.
It handles:
- Email, subject, body, CC/BCC
- Live preview and copyable HTML
- Obfuscation so spam bots can’t scrape your email
HTML Email Tag?
There’s no actual <email> tag in HTML. Use <a href="mailto:..."> to create email links. That’s it.
HTML Code to Send Email on Button Click
Want a nicer looking button instead of a plain link? Style it with CSS:
<a href="mailto:someone@example.com?subject=Hello" style="padding:10px 20px; background:#0073e6; color:#fff; text-decoration:none; border-radius:5px;">Email Us</a>It’ll look like a real button and still open the user’s email app.
???? Protect Your Email from Spam with Obfuscation
If you just paste your email address in plain text (even inside a link), spam bots can easily scrape it and flood your inbox. That’s where obfuscation comes in.
My Email Link HTML Generator includes an option to encode your email link using HTML character entities. This turns every letter into a code like m for m and a for a.
Here’s what that looks like:
<a href="mailto:tony@example.com">Email Me</a>It still works exactly the same in the browser, but bots won’t recognize it as an email address. It’s a simple, code-free way to stay off spam lists.
Final Thoughts
Adding email links in HTML is simple, but doing it right—without exposing yourself to spam or breaking the link formatting—takes a few extra steps.
If you want to skip all the manual formatting, just use our free Email Link HTML Generator. You’ll get a perfect link every time, plus extras like character encoding and button-friendly HTML.
FAQs About HTML Email Links
How do you code an email link in HTML?
Use <a href="mailto:someone@example.com">Email</a>—or customize it with subject and body using query parameters.
How do I hyperlink an email address?
Use an anchor tag with mailto: in the href field.
What is a mailto link generator?
It’s a tool that builds email links for you. Ours includes extras like CC, BCC, and anti-spam options.
What is the HTML email tag?
There’s no <email> tag—use <a href="mailto:..."> to link to an email.
How do I send an email from an HTML button?
Use a styled <a> tag that links to a mailto: address.
📄 Download a PDF of This Article










