public function email($value, $default = false, $checkMxRecord = false)
	{
		if (!$value = filter_var($value, FILTER_VALIDATE_EMAIL)) {
			return $default;
		}
		$dom = explode("@", $value);
		$dom = array_pop($dom);
		if (!$this->url("http://$dom")) {
			return $default;
		}

		return (!$checkMxRecord || checkdnsrr($dom, "MX")) ? $value : $default;
	}
public function email($value, $default = false, $checkMxRecord = false)
	{
		if (!$value = filter_var($value, FILTER_VALIDATE_EMAIL)) {
			return $default;
		}
		$dom = explode("@", $value);
		$dom = array_pop($dom);
		if (!$this->url("http://$dom")) {
			return $default;
		}

		return (!$checkMxRecord || checkdnsrr($dom, "MX")) ? $value : $default;
	}
public function email ( $ value , $ default = false , $ checkMxRecord = false ) { if ( ! $ value = filter_var ( $ value , FILTER_VALIDATE_EMAIL ) ) { return $ default ; } $ dom = explode ( "@" , $ value ) ; $ dom = array_pop ( $ dom ) ; if ( ! $ this -> url ( "http://$dom" ) ) { return $ default ; } return ( ! $ checkMxRecord || checkdnsrr ( $ dom , "MX" ) ) ? $ value : $ default ; }
Validates email.

@param string $value
@param mixed $default - default value to return on validation failure
@param boolean $checkMxRecord - check existence of MX record. If check fails default value will be returned.

@return mixed
Validates email .