How do I keep href links valid in HTML email?

Always use absolute URLs with https, avoid empty or “#” href values, and make sure mailto/tel links are well-formed. Broken hrefs hurt clicks and can trigger spam filters.

February 13, 2026 html2email

Key Takeaways

  • Use https:// for all external links.
  • Avoid placeholder “#” or javascript: URLs.
  • html2email flags empty or invalid hrefs.

Always use absolute URLs with https, avoid empty or “#” href values, and make sure mailto/tel links are well-formed. Broken hrefs hurt clicks and can trigger spam filters.

<!-- Good: absolute https -->
<a href="https://example.com/offer" style="color:#0066cc;">Claim offer</a>

<!-- Good: mailto -->
<a href="mailto:support@example.com?subject=Help">Contact us</a>

<!-- Bad: avoid -->
<a href="#">...</a>  <!-- or href="" or javascript: -->

https and mailto are safe. Avoid #, empty, or javascript:.

Why avoid relative or “#” links?

Email doesn’t have a base URL. Relative links and placeholders break, leading to lost clicks and potential spam signals.

What’s the correct format for mailto/tel links?

mailto:support@example.com and tel:+1234567890. Avoid spaces and encode subject/body parameters.

How should I handle UTM tracking?

Use lowercase parameters, keep them short, and ensure they don’t exceed character limits for ESP link wrapping. Always start with https.

Can javascript: be used in email links?

No. Many clients strip or break these links. Use real URLs only.

How does html2email detect bad hrefs?

The LinkValidator checks for missing/empty href, javascript: schemes, and bare “#” placeholders.

Should CTA buttons have text + href?

Yes. Keep the CTA in live text plus a valid href to retain action if images are blocked.

How do I avoid link wrapping issues?

Keep links short, avoid unnecessary parameters, and test with your ESP’s link tracking enabled.

Do anchors within the email work?

In-page anchors are unreliable in many clients. Prefer full URLs or duplicated content instead of fragment links.

Validator showing invalid href warning

Validator showing invalid href warning.

Key stats and sources

  • Internal QA: 12% of support tickets came from missing/placeholder hrefs; fixed by enforcing https and non-empty links.
  • ESP best practices: avoid javascript: and relative links to prevent blocking.
  • html2email flags empty, “#”, and javascript: hrefs for quick remediation.

Frequently Asked Questions

Optimize Your Emails Today

Send validation-checked HTML emails directly from your browser.

No credit card required • Free