Formify Docs

Email

Validate email addresses

Email

The email rule checks that a value is a syntactically valid email address.

What it checks

A string matching name@domain.tld — one or more characters before and after @, a dot-separated domain, and no whitespace:

/^[^\s@]+@[^\s@]+\.[^\s@]+$/

It does not verify that the mailbox exists; it only validates the format.

Config flag

validationSchema: {
  email: { email: true },
}

With a custom message:

email: { email: "Enter a valid email" }

V builder

import { V } from "formify-js";

V.email()                    // default message
V.email("Enter a valid email")

Default message

Please enter a valid email address

Things to know

  • Empty values pass unless required: true is also set.
  • Pair with normalize: "trim" to strip accidental whitespace before validation.

On this page