# `MishkaCmsCore.Accounts.Validations.ValidEmail`
[🔗](https://github.com/mishka-group/mishka_cms_core/blob/v0.0.1/lib/mishka_cms_core/accounts/__validations/valid_email.ex#L5)

Validates email addresses according to RFC 5322 standards.

This validation performs comprehensive email format checking to ensure that email
addresses meet technical specifications and common usage patterns. It validates
both the local part (before @) and domain part (after @) of email addresses,
enforcing length limits, character restrictions, and structural requirements.

The validation checks include: empty string detection, space character prohibition,
@ symbol presence and uniqueness, maximum length constraints (254 total, 64 for
local part), and full RFC 5322 regex pattern matching. The regex supports quoted
strings, IP addresses in brackets, and internationalized domain names.

The validation is case-insensitive and trims whitespace before processing. It can
be configured to validate any field through the `:field` option, defaulting to the
`:email` attribute. Nil values are considered valid to allow optional email fields.

# `validate`

Validates an email address field in the changeset.

## Options
- `:field` - The field to validate (defaults to `:email`)

## Returns
- `:ok` if the email is valid or nil
- `{:error, field: atom(), message: String.t()}` with specific validation failure message

---

*Consult [api-reference.md](api-reference.md) for complete listing*
