framework/validators/CEmailValidator.php
public function validateValue($value)
	{
		if(is_string($value) && $this->validateIDN)
			$value=$this->encodeIDN($value);
		// make sure string length is limited to avoid DOS attacks
		$valid=is_string($value) && strlen($value)<=254 && (preg_match($this->pattern,$value) || $this->allowName && preg_match($this->fullPattern,$value));
		if($valid)
			$domain=rtrim(substr($value,strpos($value,'@')+1),'>');
		if($valid && $this->checkMX && function_exists('checkdnsrr'))
			$valid=checkdnsrr($domain,'MX');
		if($valid && $this->checkPort && function_exists('fsockopen') && function_exists('dns_get_record'))
			$valid=$this->checkMxPorts($domain);
		return $valid;
	}
public function validateValue($value)
	{
		if(is_string($value) && $this->validateIDN)
			$value=$this->encodeIDN($value);
		// make sure string length is limited to avoid DOS attacks
		$valid=is_string($value) && strlen($value)<=254 && (preg_match($this->pattern,$value) || $this->allowName && preg_match($this->fullPattern,$value));
		if($valid)
			$domain=rtrim(substr($value,strpos($value,'@')+1),'>');
		if($valid && $this->checkMX && function_exists('checkdnsrr'))
			$valid=checkdnsrr($domain,'MX');
		if($valid && $this->checkPort && function_exists('fsockopen') && function_exists('dns_get_record'))
			$valid=$this->checkMxPorts($domain);
		return $valid;
	}
public function validateValue ( $ value ) { if ( is_string ( $ value ) && $ this -> validateIDN ) $ value = $ this -> encodeIDN ( $ value ) ; // make sure string length is limited to avoid DOS attacks $ valid = is_string ( $ value ) && strlen ( $ value ) <= 254 && ( preg_match ( $ this -> pattern , $ value ) || $ this -> allowName && preg_match ( $ this -> fullPattern , $ value ) ) ; if ( $ valid ) $ domain = rtrim ( substr ( $ value , strpos ( $ value , '@' ) + 1 ) , '>' ) ; if ( $ valid && $ this -> checkMX && function_exists ( 'checkdnsrr' ) ) $ valid = checkdnsrr ( $ domain , 'MX' ) ; if ( $ valid && $ this -> checkPort && function_exists ( 'fsockopen' ) && function_exists ( 'dns_get_record' ) ) $ valid = $ this -> checkMxPorts ( $ domain ) ; return $ valid ; }
Validates a static value to see if it is a valid email.
This method is provided so that you can call it directly without going through the model validation rule mechanism.

Note that this method does not respect the {@link allowEmpty} property.

@param mixed $value the value to be validated
@return boolean whether the value is a valid email
@since 1.1.1
@see https://github.com/yiisoft/yii/issues/3764#issuecomment-75457805
Validates a static value to see if it is a valid email . This method is provided so that you can call it directly without going through the model validation rule mechanism .