Updates the current user's email address.

@param string $email
The new email address.

@return bool
TRUE if successful, FALSE otherwise.
344217
public function updateEmail($email) {
		// Make sure we're logged in and have a valid access token.
		if (!$this->auth_token || !$this->username) {
			return FALSE;
		}

		$timestamp = parent::timestamp();
		$result = parent::post(
			'/settings',
			array(
				'action' => 'updateEmail',
				'email' => $email,
				'timestamp' => $timestamp,
				'username' => $this->username,
			),
			array(
				$this->auth_token,
				$timestamp,
			)
		);

		return isset($result->param) && $result->param == $email;
	}
355344
public function getUser($email)
    {
        $user = $this->userMapper->findByEmail($email);

        if (!$user) {
            return false;
        }

        return $user;
    }
1204141
public function setEmail($email)
    {
        $this->email = $email;
        $this->referenceId = null;
        $this->executed = false;
        return $this;
    }
576048
public function thereIsAUserWithTheEmail($email)
    {
        $users = $this->getRepository()->getUserService()->loadUsersByEmail($email);

        Assertion::assertGreaterThan(0, count($users), "No user was found with the email '$email'");
        Assertion::assertInstanceOf('eZ\Publish\API\Repository\Values\User\User', $users[0]);
    }
852036
public function exists($email)
    {
        $url = $this->gravatar->buildGravatarURL($email);
        $headers = get_headers($url, 1);
	    
        return (boolean) strpos($headers[0], '200');
    }
799642
public function setSender($email)
    {
        $mail = new Email($email);
        $parts = $mail->parse();

        $this->fromUser = $parts[0];
        $this->fromDomain = $parts[1];
    }
1282651
public function requestEmailChange($email)
    {
        if ($email !== $this->email) {
            $this->raise(new EmailChangeRequested($this, $email));
        }

        return $this;
    }
629795
public function reset($email)
    {
        $rules = [
            'email' => ['required' => true, 'email' => true],
        ];
        $input = [
            'email' => $email,
        ];
        $requireValidate = new Validation($input, $rules);
        if ($requireValidate->fail()) {
            Error::set($requireValidate->error()->get());
        }
        $user = new User();
        if (!$user->isEmail($email)) {
            Error::set(__config()->auth->errors->email_not_exist, 'username');
        }
        if (!$user->isLogin()) {
            if ($this->fail() !== true) {
                $id = $user->getByWhere('email', $email)[0]['id'];
                $resetToken = (new Site())::salts(8);
                $update = new Update();
                $update->update(['resetToken' => $resetToken], $id);
                $link = site_base_url().__config()->auth->reset_password_link.$resetToken;
                $subject = __printl('auth:subject:reset');
                $link = site_base_url().__config()->auth->reset_password_link.'/'.$token;
                $html = __printl('auth:body:reset');
                $html = str_replace(':email', $email, $html);
                $html = str_replace(':link', $link, $html);
                (new EmailHandler($subject, $html, $email));
                Success::set(__printl('auth:success:reset'));
            }
        } else {
            Error::set(__printl('auth:error:already:login'), 'login');
        }
    }
110122
public function checkEmailChange()
    {
        // check if user didn't change email
        if ($this->email == $this->getOldAttribute("email")) {
            return false;
        }

        // check if we need to confirm email change
        if (!$this->module->emailChangeConfirmation) {
            return false;
        }

        // check if user is removing email address (only valid if Module::$requireEmail = false)
        if (!$this->email) {
            return false;
        }

        // update status and email before returning new email
        $newEmail = $this->email;
        $this->status = static::STATUS_UNCONFIRMED_EMAIL;
        $this->email = $this->getOldAttribute("email");
        return $newEmail;
    }
558687
public function email($email = null)
  {
    $eml = EmailAddress::newInstance($this);
    if($email !== null)
    {
      $eml->setEmailAddress($email);
    }
    return $eml;
  }
594911
public function setReplyTo($email) {
    if (!$this->checkValidEmail($email)) {
      throw new \InvalidArgumentException(
          "Invalid reply-to: ". htmlspecialchars($email));
    }
    $this->message->setReplyto($email);
  }
1125463
public function setEmail($email)
    {
        if (!empty($email) && is_string($email) && ctype_print($email)) {
            $this->email = trim($email);
        }

        return $this;
    }
955170
public function sendEmail($email)
    {
        return Yii::$app->mailer->compose()
            ->setTo($email)
            ->setFrom([$this->email => $this->name])
            ->setSubject($this->subject)
            ->setTextBody($this->body)
            ->send();
    }
1260433
public function isEmailUnique($email)
    {
        $this->find("email", $email);
        if (isset($this->id)) {
            return false;
        }
        return true;
    }
826951
public function isAdmin(?string $email = null): bool
    {
        if ($email === null) {
            return false;
        }
        return in_array($email, $this->getConfig()['admin']);
    }
117168
public function thereAreNoUsersWithTheEmail($email)
    {
        $users = $this->getRepository()->getUserService()->loadUsersByEmail($email);
        Assertion::assertEquals(0, count($users), "Users with the email '$email' exist");
    }
33361
public function isEmailUnique($email)
    {
        if ($email) {
            try {
                $this->userRepository->findUserByEmail($email);
            } catch (NoResultException $exc) {
                return true;
            }
        }

        return false;
    }