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

This mailto: link has a space somewhere in its address, and a URL can't contain a raw space.

The validator says the space comes "after ilto:", which means anywhere after the scheme, not only right after the colon. It flags a space typed after mailto:, a space inside the address, a space after the comma between two recipients, and text or markup left in the attribute after the address, such as mailto:info@example.com <br>. That last case shows up when a template or CMS field drops HTML into the link.

A mailto: URL, defined in RFC 6068, holds one or more bare email addresses after the colon. Some browsers open the mail client anyway, but the extra text can end up in the recipient field.

A space inside the subject or body parameters triggers a different message, "Illegal character in query". Encode those spaces as %20.

To fix it, remove the spaces and anything after the address that isn't part of it. Separate several recipients with a comma and no space.

Invalid example

<a href="mailto: info@example.com">Email us</a>
<a href="mailto:info@example.com, sales@example.com">Email us</a>
<a href="mailto:info@example.com <br>">Email us</a>

Valid example

<a href="mailto:info@example.com">Email us</a>
<a href="mailto:info@example.com,sales@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
€5 / week

1K Weekly

1,000 monthly checks. Cancel anytime.

Get 1K Weekly →

Join teams across 40+ countries