@param string $email

@return bool
543169
protected function isEmailValid($email)
    {
        $constraint = new EmailConstraint();
        $result = $this->get('validator')->validate($email, $constraint);

        return 0 === count($result);
    }
866731
public function getObfuscatedEmail($email)
    {
        if (false !== $pos = strpos($email, '@')) {
            $email = '...'.substr($email, $pos);
        }

        return $email;
    }
464224
public static function getByEmail($email)
    {
        $fields = self::getDbConnection()->fetchAssoc('SELECT * FROM '.User::TABLE.' WHERE email = ?', array($email));
        if (!$fields) return false;
        return self::fetch($fields);       
  	}
913511
public function isRole($email)
    {
        if (! $this->isEmail($email)) {
            return null;
        }

        $user = $this->userFromEmail($email);

        if ($user) {
            // Load disposable domains
            if (is_null($this->role)) {
                $this->role = include('data/role.php');
            }

            // Search array for hostname
            if (in_array($user, $this->role)) {
                return true;
            }

            return false;
        }

        return null;
    }
883493
protected function checkValidEmail($email) {
    if (function_exists('mailparse_rfc822_parse_addresses')) {
      $parsed = mailparse_rfc822_parse_addresses($email);
      if (count($parsed) > 0 && array_key_exists('address', $parsed[0])) {
        $email = $parsed[0]['address'];
      } else {
        return false;
      }
    }
    return filter_var($email, FILTER_VALIDATE_EMAIL) !== false;
  }
460776
protected function getByEmail($email) {
        $users = $this->_client->get('/users?search='.urlencode($email));
        return isset($users[0]) ? $users[0] : false;
    }
279445
public function setReplyTo($email)
    {
        if ($this->isValidEmail($email) === true) {
            $this->reply_to = $email;
        } else {
            return false;
        }
    }
938395
public static function email($email)
	{
		$atIndex = strrpos($email, '@');
		if (false === $atIndex)
		{
			return false;
		}
		else
		{
			$domain = substr($email, $atIndex + 1);
			$local = substr($email, 0, $atIndex);
			if (! strpos($domain, '.'))
			{
				return false;
			}
			else
			{
				$localLen = strlen($local);
				$domainLen = strlen($domain);
				if ($localLen < 1 || $localLen > 64)
				{
					// 本地部分长度超过
					return false;
				}
				else if ($domainLen < 1 || $domainLen > 255)
				{
					// 超出域部分长度
					return false;
				}
				else if ('.' === $local[0] || '.' === $local[$localLen - 1])
				{
					// 本地部分开始或结尾'.'
					return false;
				}
				else if (preg_match('/\\.\\./', $local))
				{
					// 本地部分已经连续两个点
					return false;
				}
				else if (! preg_match('/^[A-Za-z0-9\\-\\.]+$/', $domain))
				{
					// 字符不是有效的域部分
					return false;
				}
				else if (preg_match('/\\.\\./', $domain))
				{
					// 域部分已经连续两个点
					return false;
				}
				else if (! preg_match('/^(\\\\.|[A-Za-z0-9!#%&`_=\\/$\'*+?^{}|~.-])+$/', str_replace('\\\\', '', $local)))
				{
					// 除非本地部分是引用字符不是有效的本地部分
					if (! preg_match('/^"(\\\\"|[^"])+"$/', str_replace('\\\\', '', $local)))
					{
						return false;
					}
				}
			}
		}
		return true;
	}
177650
public static function isValid(string $email, bool $useExampleDomainCheck = false, bool $useTypoInDomainCheck = false, bool $useTemporaryDomainCheck = false, bool $useDnsCheck = false): bool
    {
        if (!isset($email[0])) {
            return false;
        }

        // make sure string length is limited to avoid DOS attacks
        $emailStringLength = \strlen($email);
        if (
            $emailStringLength >= 320
            ||
            $emailStringLength <= 2 // i@y //
        ) {
            return false;
        }
        unset($emailStringLength);

        $email = \str_replace(
            [
                '.', // non-Latin chars are also allowed | https://tools.ietf.org/html/rfc6530
                '＠', // non-Latin chars are also allowed | https://tools.ietf.org/html/rfc6530
            ],
            [
                '.',
                '@',
            ],
            $email
        );

        if (
            (\strpos($email, '@') === false) // "at" is needed
            ||
            (\strpos($email, '.') === false && \strpos($email, ':') === false) // "dot" or "colon" is needed
        ) {
            return false;
        }

        if (!\preg_match('/^(?<local>.*<?)(?:.*)@(?<domain>.*)(?:>?)$/', $email, $parts)) {
            return false;
        }

        $local = $parts['local'];
        $domain = $parts['domain'];

        if (!$local) {
            return false;
        }

        if (!$domain) {
            return false;
        }

        // Escaped spaces are allowed in the "local"-part.
        $local = \str_replace('\\ ', '', $local);

        // Spaces in quotes e.g. "firstname lastname"@foo.bar are also allowed in the "local"-part.
        $quoteHelperForIdn = false;
        if (\preg_match('/^"(?<inner>[^"]*)"$/mU', $local, $parts)) {
            $quoteHelperForIdn = true;
            $local = \trim(
                \str_replace(
                    $parts['inner'],
                    \str_replace(' ', '', $parts['inner']),
                    $local
                ),
                '"'
            );
        }

        if (
            \strpos($local, ' ') !== false // no spaces allowed, anymore
            ||
            \strpos($local, '".') !== false // no quote + dot allowed
        ) {
            return false;
        }

        list($local, $domain) = self::punnycode($local, $domain);

        if ($quoteHelperForIdn === true) {
            $local = '"' . $local . '"';
        }

        $email = $local . '@' . $domain;

        if (!\filter_var($email, \FILTER_VALIDATE_EMAIL)) {
            return false;
        }

        if ($useExampleDomainCheck === true && self::isExampleDomain($domain) === true) {
            return false;
        }

        if ($useTypoInDomainCheck === true && self::isTypoInDomain($domain) === true) {
            return false;
        }

        if ($useTemporaryDomainCheck === true && self::isTemporaryDomain($domain) === true) {
            return false;
        }

        if ($useDnsCheck === true && self::isDnsError($domain) === true) {
            return false;
        }

        return true;
    }
483134
public function send(\SendGrid\Mail\Mail $email)
    {
        return $this->client->mail()->send()->post($email);
    }
48239
public function filterEmail($email)
    {
        foreach ($this->filters as $filter) {
            $shouldKeepEmail = $filter->checkEmail($email);
            if (!$shouldKeepEmail) {
                return true;
            }
        }

        return false;
    }
277045
public static function CheckEmail($email){
		   if(preg_match("/^[\-\!\#\$\%\&\'\*\+\.\/0-9\=\?A-Z\^\_\`a-z\{\|\}\~]+\@([\-\!\#\$\%\&\'\*\+\/0-9\=\?A-Z\^\_\`a-z\{\|\}\~]+\.)+[a-zA-Z]{2,6}$/", $email)){
		   	  $var=explode("@",$email);
		   	  $var=array_pop($var);
		      if(checkdnsrr($var,"MX")){return true;}else{return false;}
		   }else{
		      return false;
		   }
		}
1071313
public function existsByEmail ($email)
    {
        $entity = $this->er->findOneBy(array('email' => $email));

        if (NULL == $entity) {
            return false;
        } else {
            return true;
        }
    }
1333738
public function isDisposable($email)
    {
        if (! $this->isEmail($email)) {
            return null;
        }

        $hostname = $this->hostnameFromEmail($email);

        if ($hostname) {
            // Load disposable domains
            if (is_null($this->disposable)) {
                $data = new \EmailData\Data();
                $file = $data->getPathToDataFile('php');
                $this->disposable = include($file);
            }

            // Search array for hostname
            if (in_array($hostname, $this->disposable)) {
                return true;
            }

            return false;
        }

        return null;
    }
177233
public static function isEmail($email) {
        if (!is_string($email) || strlen($email) > 255)
            return false;
        if (Tools::phpVersionCompareTo('5.3.3') >= 0)
            return (boolean) filter_var($email, FILTER_VALIDATE_EMAIL);
        else
            return (boolean) preg_match('`^(?!\.)[.\w!#$%&\'*+/=?^_\`{|}~-]+@(?!-)[\w-]+\.\w+$`i', $email);
    }
346233
public function emailStatByCampaigns($email)
    {
        if (empty($email)) {
            return $this->handleError('Empty email');
        }

        $requestResult = $this->sendRequest('emails/' . $email . '/campaigns');

        return $this->handleResult($requestResult);
    }
101196
public function isEmailBanned($email)
    {
        $emailTemplates = $this->getEmailTemplates();

        foreach ($emailTemplates as $emailTemplate) {
            $emailRule = new Email($emailTemplate);
            if ($emailRule->check($email)) {
                return true;
            }
        }
        return false;
    }