Send the 'reset password' email.
174491
def send_reset_password_email(self, user, user_email):
        """"""

        # Verify config settings
        if not self.user_manager.USER_ENABLE_EMAIL: return
        assert self.user_manager.USER_ENABLE_FORGOT_PASSWORD

        # The reset_password email is sent to a specific user_email.email or user.email
        email = user_email.email if user_email else user.email

        # Generate a reset_password_link
        token = self.user_manager.generate_token(user.id)
        reset_password_link = url_for('user.reset_password', token=token, _external=True)

        # Render email from templates and send it via the configured EmailAdapter
        self._render_and_send_email(
            email,
            user,
            self.user_manager.USER_RESET_PASSWORD_EMAIL_TEMPLATE,
            reset_password_link=reset_password_link,
        )
1140171
public function sendEmail()
    {
        $this->validate(request(), ['email' => 'required|email']);

        // Attempt to send the email.
        $this->forgotPassword->sendEmail(request('email'));

        return redirect(route('auth.password.sent'));
    }
373021
def forgot_password():
    """"""

    form_class = _security.forgot_password_form

    if request.is_json:
        form = form_class(MultiDict(request.get_json()))
    else:
        form = form_class()

    if form.validate_on_submit():
        send_reset_password_instructions(form.user)
        if not request.is_json:
            do_flash(*get_message('PASSWORD_RESET_REQUEST',
                     email=form.user.email))

    if request.is_json:
        return _render_json(form, include_user=False)

    return _security.render_template(config_value('FORGOT_PASSWORD_TEMPLATE'),
                                     forgot_password_form=form,
                                     **_ctx('forgot_password'))
786684
def send_email(self, user, subject, msg):
        """"""
        print('To:', user)
        print('Subject:', subject)
        print(msg)
1264701
protected function send()
    {
//      reset of these properties each time when the database was queried
        $this->reset();

        $this->stmt = $this->pdo->prepare($this->query);
        if (! $this->stmt->execute($this->params)) {
            $this->setError(true);
        }
    }
343363
public function sendEmail()
    {
        /* @var $user User */
        $user = Administrator::find()->where([
            'status' => Administrator::STATUS_ACTIVE,
            'email' => $this->email,
        ])->one();

        if ($user) {
            if (!Administrator::isPasswordResetTokenValid($user->password_reset_token)) {
                $user->generatePasswordResetToken();
            }

            if ($user->save()) {
                Email::create()
                    ->html(Yii::$app->view->renderFile('@core/views/emails/passwordResetToken.php', ['user' => $user]))
                    ->subject("Reset Password")
                    ->to(['email' => $user->email, 'name'=> $user->name])
                    ->send();

                return true;
            } else {
                return false;
            }
        }

        return false;
    }
550203
def update(self, new_email_address, name, access_level, password=None):
        """"""
        params = {"email": self.email_address}
        body = {
            "EmailAddress": new_email_address,
            "Name": name,
            "AccessLevel": access_level,
            "Password": password}
        response = self._put("/clients/%s/people.json" % self.client_id,
                             body=json.dumps(body), params=params)
        # Update self.email_address, so this object can continue to be used
        # reliably
        self.email_address = new_email_address
508958
def lost_passwd(self, data):
        
        error = False
        msg = ""

        # Check input format
        email_re = re.compile(
            r"(^[-!#$%&'*+/=?^_`{}|~0-9A-Z]+(\.[-!#$%&'*+/=?^_`{}|~0-9A-Z]+)*"  # dot-atom
            r'|^"([\001-\010\013\014\016-\037!#-\[\]-\177]|\\[\001-011\013\014\016-\177])*"'  # quoted-string
            r')@(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+[A-Z]{2,6}\.?$', re.IGNORECASE)  # domain
        if email_re.match(data["recovery_email"]) is None:
            error = True
            msg = _("Invalid email format.")

        if not error:
            reset_hash = hashlib.sha512(str(random.getrandbits(256)).encode("utf-8")).hexdigest()
            user = self.database.users.find_one_and_update({"email": data["recovery_email"]}, {"$set": {"reset": reset_hash}})
            if user is None:
                error = True
                msg = _("This email address was not found in database.")
            else:
                try:
                    web.sendmail(web.config.smtp_sendername, data["recovery_email"], _("INGInious password recovery"),
                                 _("""Dear {realname},

Someone (probably you) asked to reset your INGInious password. If this was you, please click on the following link :
""").format(realname=user["realname"]) + web.ctx.home + "/register?reset=" + reset_hash)
                    msg = _("An email has been sent to you to reset your password.")
                except:
                    error = True
                    msg = _("Something went wrong while sending you reset email. Please contact the administrator.")

        return msg, error
924978
def send_mail(subject, body, smtp_server, user, password, from_addr, to_addrs):
    ''' 
    '''
    logging.info('Send status E-Mail (' + subject + ')')
    content = string.join((
        "From: %s" % from_addr,
        "To: %s" % ','.join(to_addrs),  # comma separated according to RFC822
        "Subject: %s" % subject,
        "",
        body),
        "\r\n")
    server = smtplib.SMTP_SSL(smtp_server)
    server.login(user, password)
    server.sendmail(from_addr, to_addrs, content)
    server.quit()
203003
function onSendPasswordResetEmail() {
  var email = $('#password-reset-email').val();
  auth.sendPasswordResetEmail(email, getActionCodeSettings()).then(function() {
    alertSuccess('Email sent!');
  }, onAuthError);
}
983522
public function sendResetLinkEmail(Request $request)
    {
        $this->validate($request, ['email' => 'required|email']);

        // We will send the password reset link to this user. Once we have attempted
        // to send the link, we will examine the response then see the message we
        // need to show to the user. Finally, we'll send out a proper response.
        $response = $this->broker()->sendResetLink(
            $request->only('email')
        );

        switch ($response) {
            case Password::RESET_LINK_SENT:
                return response()->json([
                    'success' => true
                ]);

            case Password::INVALID_USER:
            default:
                return response()->json([
                    'success' => false,
                    'message' => 'Invalid user'
                ]);
        }
    }
861311
def send_reset_password_link(request):
    '''
    
    '''
    if not registration_settings.RESET_PASSWORD_VERIFICATION_ENABLED:
        raise Http404()
    serializer = SendResetPasswordLinkSerializer(data=request.data)
    serializer.is_valid(raise_exception=True)
    login = serializer.validated_data['login']

    user = None
    for login_field in get_login_fields():
        user = get_user_by_lookup_dict(
            {login_field: login}, default=None, require_verified=False)
        if user:
            break

    if not user:
        raise UserNotFound()

    signer = ResetPasswordSigner({
        'user_id': user.pk,
    }, request=request)

    template_config = (
        registration_settings.RESET_PASSWORD_VERIFICATION_EMAIL_TEMPLATES)
    send_verification_notification(user, signer, template_config)

    return get_ok_response('Reset link sent')
1105857
def resetPassword(self, userId):
    '''
    
    '''
    self._setHeaders('resetPassword')
    return self._sforce.service.resetPassword(userId)
680846
def send_password_reset_notice(user):
    
    if config_value('SEND_PASSWORD_RESET_NOTICE_EMAIL'):
        _security.send_mail(config_value('EMAIL_SUBJECT_PASSWORD_NOTICE'),
                            user.email, 'reset_notice', user=user)
1094619
public function sendResetLinkEmail(Request $request)
    {
        $this->validate($request, ['email' => 'required|email']);

        //We will send the password reset link to this user. Once we have attempted
        //to send the link, we will examine the response then see the message we
        //need to show to the user. Finally, we'll send out a proper response.
        $response = Password::broker()->sendResetLink($request->only('email'));

        if ($response == 'passwords.sent') {
            notify()->success('Success!', 'Password email sent to client.');
        }
        else {
            notify()->error('Oops', 'Something went wrong', 'warning shake animated');
        }

        return redirect()->back();
    }
508363
def send_password_changed_email(self, user):
        """"""

        # Verify config settings
        if not self.user_manager.USER_ENABLE_EMAIL: return
        if not self.user_manager.USER_SEND_PASSWORD_CHANGED_EMAIL: return

        # Notification emails are sent to the user's primary email address
        user_or_user_email_object = self.user_manager.db_manager.get_primary_user_email_object(user)
        email = user_or_user_email_object.email

        # Render email from templates and send it via the configured EmailAdapter
        self._render_and_send_email(
            email,
            user,
            self.user_manager.USER_PASSWORD_CHANGED_EMAIL_TEMPLATE,
        )
946003
def send_email(self, message):
        """"""
        msg = MIMEMultipart()
        msg['From'] = self.from_address
        msg['To'] = self.to_address
        msg['Subject'] = self.title
        msg.attach(MIMEText('<pre>' + cgi.escape(message) + '</pre>', 'html'))
        smtp = smtplib.SMTP(self.server, self.port,
                            timeout=self.timeout)
        if self.tls_auth:
            smtp.starttls()
            smtp.login(self.user, self.password)
        smtp.sendmail(self.from_address, self.to_address, msg.as_string())
        smtp.quit()