Skip to main content

HTML Guide

Bad value “mailto:X” for attribute “href” on element “a”: Illegal character in scheme data: space is not allowed.

A space character in the email address within the mailto: link is invalid syntax.

The href attribute on an <a> tag must contain a valid email address after mailto: in order to conform to HTML standards. Email addresses cannot contain spaces. Including a space (as in user@example com) results in invalid markup.

Correct usage:
Remove any spaces from the email address and use a correctly formatted address such as user@example.com.

Invalid example

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

Valid example

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

Learn more:

Related W3C validator issues