More in this section

Forums / Security / Reset passowrd email

Reset passowrd email

2 posts, 0 answered
  1. Adam
    Adam avatar
    33 posts
    23 Feb 2009
    25 Nov 2009
    Link to this post
    Are users supposed to be sent an email when thieir password is reset in the CMS?

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    12 Sep 2017
    26 Nov 2009
    Link to this post
    Hi Adam,

    There is no built in functionality for sending emails when you reset the password from the backend. You can modify Sitefinity/Admin/CmsAdmin/Users.aspx.cs and subscribe for Button.Click event of the reset button as shown below:

    protected void passwordRecoveryButton_Click(object sender, EventArgs e)
          string newPassword = manageUsers.Manager.MembershipProvider.ResetPassword(manageUsers.UserName, "42");
          Telerik.Security.WebControls.ManageUsers.EditContainer editContainer = manageUsers.GetCurrentContainer() as Telerik.Security.WebControls.ManageUsers.EditContainer;
          if (editContainer != null)
              Control passRecovery = editContainer.FindControl("passwordRecoveryButton");
              if (passRecovery != null)
                  int index = editContainer.Controls.IndexOf(passRecovery);
                  Literal newPass = new Literal();
                  newPass.Text = "New password: ";
                  Label newNote = new Label();
                  Literal passLiteral = new Literal();
                  passLiteral.Text = newPassword;
                  HtmlGenericControl strong = new HtmlGenericControl("strong");
                  editContainer.Controls.AddAt(index + 1, newNote);
                  string senderMail = "senderMailhere"
                  string userName = manageUsers.UserName;
                  MembershipUser user = Membership.GetUser(userName);
                  MailMessage message = new MailMessage(senderMail, user.Email);
                  message.Body = newPass.Text + passLiteral.Text;
                  SmtpClient client = new SmtpClient();

    By doing so you will be able to send email to the user which password is reset. The email body will contain the new password.

    All the best,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
2 posts, 0 answered