Email¶
Checks if a field contains a valid email and if a MX record exists for the domain of an email address.
If the user enters an email address like “user@example.tld”, Formhandler checks if a valid MX record exists for the domain “example.tld”.
This doesn’t ensure that the mailbox “user@example.tld” exists or that the MX record points to a running server, but at least makes sure that there is a mail server setup for this domain.
Example Code:
validators {
DefaultValidator {
model = DefaultValidator
config {
fields {
email.errorChecks {
required {
model = Required
}
email {
model = Email
}
}
}
}
}
}