# Bad value “mailto: X” for attribute “href” on element “a”: Illegal character after “ilto:”. Space 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-space-is-not-allowed
> Attribution: Rocket Validator (https://rocketvalidator.com)
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

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](https://datatracker.ietf.org/doc/html/rfc6068). 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

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

### Valid

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