You can use what uses the email restriction:
import org.apache.commons.validator.EmailValidator
...
static constraints = {
emailAddresses validator: { value, obj, errors ->
def emailValidator = EmailValidator.getInstance()
for (email in value.split(';')) {
if (!emailValidator.isValid(email)) {
// call errors.rejectValue(), or return false, or return an error code
}
}
}
}
source
share