/** * @param string $pattern Default value = NULL * @param string $errorMsg Default value = NULL */ public function setEmailValid($pattern = NULL, $errorMsg = NULL) { $errorMsg = is_null($errorMsg) ? $this->_defaultMsg : $errorMsg; $pattern = is_null($pattern) ? $this->_defaultPattern : $pattern; $rule = new EmailRule(); $rule->setRule($pattern); $this->_validRules[] = array(0 => $rule, 1 => $errorMsg); }
protected function checkDomain($value) { parent::checkDomain($value); if ($this->isValid()) { if (!checkdnsrr($value, "MX")) { $this->error('EMAIL_DNS'); } } }