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

