Coding Hubs School of AI – Best AI & Full Stack Courses in Delhi NCR | 100% Placement
Limited Offer: Get 50% OFF on AI & Full Stack Courses
📞 Call Now: +91 8448811540
Back to HTML Notes
Topic #307

Email Links

An email link opens the visitor's default email application with a message already addressed — using the mailto: URL scheme instead of a normal web address.

Syntax

<a href="mailto:hello@codingnowai.in">Email us</a>

Basic Example

<p>Questions? <a href="mailto:support@codingnowai.in">support@codingnowai.in</a></p>

Browser output: a normal-looking link; clicking it launches the user's configured email app (Outlook, Gmail app, Mail, etc.) with a new message already addressed to that address.

How It Works

The browser recognizes the mailto: scheme and hands the request off to whatever email application (or web-based mail handler) is registered on the visitor's device — HTML itself never sends the email; it just opens the compose window.

Important Attributes / Query Parameters

ParameterPurposeExample
subjectPre-fills the subject line?subject=Course%20Inquiry
bodyPre-fills the message body?body=Hi%20team%2C
ccPre-fills a CC recipient?cc=team@codingnowai.in

Multiple parameters are joined with &amp;, and spaces/special characters must be URL-encoded (a space becomes %20).

Real-World Example

<a href="mailto:admissions@codingnowai.in?subject=Course%20Inquiry&body=Hi%2C%20I%27d%20like%20to%20know%20more%20about...">
    Ask About a Course
</a>

A pre-filled inquiry link on a course page — the visitor's email app opens with the subject and a starter message already in place.

Common Mistakes

  • Forgetting to URL-encode spaces and special characters in subject/body parameters, which can break the link on some email clients
  • Displaying a raw email address as plain text without a working mailto: link, forcing users to manually copy and paste it
  • Publishing a raw email address anywhere it can be scraped by spam bots, without any obfuscation or contact-form alternative

Best Practices

  • Use a real mailto: link, not just visible plain text, so the address is one click away from an open compose window
  • For high-traffic public pages, consider a contact form instead of (or alongside) a visible mailto: link to reduce spam harvesting

Accessibility Considerations

Make sure the link text clearly indicates it's an email link, especially if you style it to not show the raw address — "Email our admissions team" is clearer than an unlabeled icon alone.

SEO Considerations

No direct ranking effect from mailto: links.

Browser & Modern HTML Notes

Behavior depends entirely on what the visitor has configured as their default mail handler — on a device with no email client configured, clicking a mailto: link can appear to do nothing, which is worth keeping in mind for mobile-heavy audiences.

Mini Practice

  1. Build an email link with a pre-filled subject line.
  2. Add a cc parameter to that same link.

Related HTML Notes

Want to go beyond the notes?

Join Coding Hubs School of AI's HTML course — live mentorship, real projects, and 100% placement support.

Enroll Now — Free Demo Available
💬 Talk to Advisor
1
WhatsApp

Latest from Our Blog

Insights on AI, Data Science, Full Stack & Career

View All Articles →