Skip to main content
HTML Validation

Bad value “mailto: X” for attribute “href” on element “a”: Illegal character after “ilto:”. Space is not allowed.

About This HTML Issue

A mailto: link must not contain spaces between the colon and the email address.

The href attribute on an <a> element accepts mailto: URLs as defined in RFC 6068. The email address must immediately follow the colon with no whitespace. Browsers may still attempt to open the mail client, but the space makes the URL technically invalid and triggers a W3C validation error.

This applies to all parts of the mailto: URL. Spaces before the address, between multiple addresses, or before query parameters like ?subject= are all invalid. If you need to include a space in a subject or body parameter, encode it as %20.

HTML examples

Invalid

<a href="mailto: user@example.com">Email us</a>

Valid

<a href="mailto:user@example.com">Email us</a>

Find issues like this automatically

Rocket Validator scans thousands of pages in seconds, detecting HTML issues across your entire site.

Help us improve our guides

Was this guide helpful?
🌍 Trusted by teams worldwide

Validate at scale.
Ship accessible websites, faster.

Automated HTML & accessibility validation for large sites. Check thousands of pages against WCAG guidelines and W3C standards in minutes, not days.

Scheduled Reports
API Access
Open Source Standards
$7 / 7 days

Pro Trial

Full Pro access. Cancel anytime.

Start Pro Trial →

Join teams across 40+ countries