Validates all the email addresses.

@return  bool|array  True if all are valid or an array of recipients which failed validation.
15472
protected function validate_addresses()
	{
		$failed = array();

		foreach (array('to', 'cc', 'bcc') as $list)
		{
			foreach ($this->{$list} as $recipient)
			{
				if ( ! filter_var($recipient['email'], FILTER_VALIDATE_EMAIL))
				{
					$failed[$list][] = $recipient;
				}
			}
		}

		if (count($failed) === 0)
		{
			return true;
		}

		return $failed;
	}
520595
protected function validateEmailUniqueUser()
    {
        $field = 'email';
        $value = $this->getSubmitted($field);

        if ($this->isError($field) || !isset($value)) {
            return null;
        }

        $updating = $this->getUpdating();

        if (isset($updating['email']) && $updating['email'] === $value) {
            return true;
        }

        $user = $this->user->getByEmail($value);

        if (empty($user)) {
            return true;
        }

        $this->setErrorExists($field, $this->translation->text('E-mail'));
        return false;
    }
1003059
public function validate()
    {
        if (count($this->_to) == 0
            && count($this->_cc) == 0
            && count($this->_bcc) == 0
        ) {
            return new SimpleEmailServiceError('Destination');
        }

        if (strlen($this->_source) == 0) {
            return new SimpleEmailServiceError('EmailSource');
        }

        if (strlen($this->_subject) == 0) {
            return new SimpleEmailServiceError('EmailSubject');
        }

        if (strlen($this->_body) == 0) {
            return new SimpleEmailServiceError('EmailBody');
        }
        return true;
    }
1258487
public function isValid()
    {
        $this->applyFilters();

        $this->validationMessage = null;

        foreach ($this->validators as $validator) {
            if (!$validator->isValid($this->translations)) {
                $this->validationMessage = $validator->getMessage();
                return false;
            }
        }

        return true;
    }
137567
public boolean validateAllFields() {
        boolean cardNumberIsValid =
                CardUtils.isValidCardNumber(mCardNumberEditText.getCardNumber());
        boolean expiryIsValid = mExpiryDateEditText.getValidDateFields() != null &&
                mExpiryDateEditText.isDateValid();
        boolean cvcIsValid = isCvcLengthValid();
        mCardNumberEditText.setShouldShowError(!cardNumberIsValid);
        mExpiryDateEditText.setShouldShowError(!expiryIsValid);
        mCvcEditText.setShouldShowError(!cvcIsValid);
        boolean postalCodeIsValidOrGone;
        if (mShouldShowPostalCode) {
            postalCodeIsValidOrGone = isPostalCodeMaximalLength(true,
                    mPostalCodeEditText.getText().toString());
            mPostalCodeEditText.setShouldShowError(!postalCodeIsValidOrGone);
        } else {
            postalCodeIsValidOrGone = true;
        }

        return cardNumberIsValid
                && expiryIsValid
                && cvcIsValid
                && postalCodeIsValidOrGone;
    }
596895
public function validateEmail($email)
    {
        if (empty($email)) {
            return false;
        }

        $validationViolationList = $this
            ->validator
            ->validate($email, new Email());

        return $validationViolationList->count() === 0;
    }
51825
public function validateEmails($attribute)
    {
        $items = $this->$attribute;

        if (!is_array($items)) {
            $items = [];
        }

        foreach ($items as $index => $item) {
            $validator = new EmailValidator();
            $error = null;
            $validator->validate($item, $error);
            if (!empty($error)) {
                $key = $attribute . '[' . $index . ']';
                $this->addError($key, $error);
            }
        }
    }
1011073
public function isValid()
    {
        //validate recurringPayment values
        $checkEmpty = array(
            $this->profileStartDate,
            $this->desc,
            $this->billingPeriod,
            $this->billingFrequency,
            $this->amt,
            $this->currencyCode,
            $this->acct,
            $this->email,
        );

        if(!$this->checkEmpty($checkEmpty) || is_null($this->_address)) {
            return false;
        }

        //address fields
        $address = $this->_address;

        $test = array(
            $address->getStreet(),
            $address->getCity(),
            $address->getState(),
            $address->getCountryCode(),
            $address->getZip()
        );

        if(!$this->checkEmpty($test)) {
            return false;
        }

        return true;
    }
932048
public function validate()
    {
        $errors = [];

        foreach ($this->fields as $field) {
            $result = $field->validate();

            if ($result->isFailure()) {
                $errors[] = $result;
            }
        }

        if ($errors) {
            $this->setErrors($errors);

            return false;
        }

        return true;
    }
279767
public function listVerifiedEmailAddresses() {
        $response = $this->_makeRequest(array(
            'Action' => 'ListVerifiedEmailAddresses'
        ));
        $dom = new DOMDocument();
        $dom->loadXML($response);
        $members = $dom->getElementsByTagName('member');
        $out = array();
        foreach ($members as $member) {
            $out[] = $member->nodeValue;
        }
        return $out;
    }
1162448
public function validate()
    {
        if (!$this->validationHash) {
            return false;
        }
        $db = Database::connection();
        $row = $db->GetRow("select * from MailValidationHashes where mHash = ? order by mDateGenerated desc limit 1", $this->validationHash);
        if ($row['mvhID'] > 0) {
            // Can't do this even though it's a good idea
            //if ($row['email'] != $this->sender) {
            //	return false;
            //} else {
                return $row['mDateRedeemed'] == 0;
            //}
        }
    }
1246312
protected function validate()
    {
        foreach ($this->_requiredAttr as $attr) {
            if (is_array($attr)) {
                $valid = false;
                foreach ($attr as $sub) {
                    if (!is_null($this->$sub)) {
                        $valid = true;
                        break;
                    }
                }
                if (!$valid) {
                    return false;
                }
            } elseif (is_null($this->$attr)) {
                return false;
            }
        }
        return true;
    }
742171
public function validateEmail($email)
    {
        $person = $this->getService('repos:people.person')->find(array('email' => $email));

        if ($person) {
            $this->setMessage('Email is already in use');
            return false;
        }

        return true;
    }
1014511
private function validate()
    {
        $required = '';

        $validations = [
            'FirstnameOrLastname',
            'PhoneCellphoneOrEmail',
            'ContactTypeId',
            'BusinessTypeId',
            'SuboriginId',
        ];

        for ($i = 0; $i < count($validations) && empty($required); $i++) {
            $required = $this->{"validate" . $validations[$i]}();
        }

        if (!empty($required)) {
            throw new InvalidArgumentException(
                sprintf('Missing required value: %s.', $required)
            );
        }
    }
890492
public function validateRules()
    {
        $input = request()->all();
        $rules = [];
        $messages = [];

        if ($this->formRequest) {
            $this->formRequest = new $this->formRequest;
            $rules = $this->formRequest->rules();
            $messages = $this->formRequest->messages();
        }

        return Validator::make($input, $rules, $messages);
    }
588951
public static function check($emails): array
    {
        $result = [];

        if (empty($emails)) {
            return $result;
        }

        $emails = self::handleEmailsInput($emails);

        foreach ($emails as $email) {
            if (!self::isValid($email)) {
                continue;
            }
            if (!in_array($email, $result, true)) {
                $result[] = $email;
            }
        }

        return $result;
    }
316246
public static function addressValidate($email)
    {
        // $this->debug->groupCollapsed(__CLASS__.'->'.__FUNCTION__);
        $return = false;
        $regex = '/^'
            .'[a-z0-9_]+([_\.-][a-z0-9]+)*'     // user
            .'@'
            .'([a-z0-9]+([\.-][a-z0-9]+)*)+'    // domain
            .'(\.[a-z]{2,})'                    // sld, tld
            .'$/i';
        $email = trim($email);
        if (preg_match($regex, $email, $matches)) {
            // $this->debug->log('properly formatted');
            $hostname   = strtolower($matches[2].$matches[4]);
            $ipaddress  = gethostbyname($hostname);     // A record
            // $this->debug->log('hostname', $hostname);
            // $this->debug->log('ipaddress', $ipaddress);
            $return = $email;
            if ($ipaddress != $hostname) {
                // $this->debug->log('A record', $ipaddress);
            } elseif ($mxrecord = getmxrr($hostname, $mxhosts)) {
                // $this->debug->log('getmxrr('.$hostname.')', $mxrecord, $mxhosts);
            } elseif (strpos($_SERVER['SERVER_NAME'], $hostname)) {
                // $this->debug->log('email domain matches server domain');
            } else {
                // $this->debug->log('warn', 'unable to verify');
                $return = false;
            }
        }
        // $this->debug->groupEnd();
        return $return;
    }