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

> Canonical HTML version: https://rocketvalidator.com/html-validation/bad-value-mailto-x-for-attribute-href-on-element-a-illegal-character-after-ilto-line-break-is-not-allowed
> Attribution: Rocket Validator (https://rocketvalidator.com)
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

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 `&#10;` 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

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

## Valid example

```html
<a class="contact-link"
  href="mailto:info@example.com">Email us</a>
```
