Skip to main content
HTML Validation

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

About This HTML Issue

This mailto: link has a line break inside its href, and a URL can't contain a raw line break.

It usually happens when the attribute value is split across two lines in the source, often right after mailto:, by a template, a CMS field or an editor that wraps long lines. The validator says the line break comes "after ilto:", which means anywhere after the scheme: right after the colon, inside the address, or after the comma between two recipients. Indentation on the next line doesn't change the message, and an encoded line break such as 
 triggers it too.

A line break at the very start or end of the value isn't reported, because leading and trailing whitespace is stripped from URLs. A line break inside the subject or body parameters gets a different message, "Tab, new line or carriage return found." To put a line break in the message body, encode it as %0D%0A.

Browsers remove line breaks from URLs before following them, so the link often still works, but the markup is invalid. Keep the whole mailto: URL on one line with no whitespace in it. If the tag gets too long, break the line between attributes instead of inside the value.

Invalid example

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

Valid example

<a class="contact-link"
href="mailto:info@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