Change the password for email verification, retrieve the password through email, and change the password to retrieve the password
Use email verification to change the password. Here I use 163 free mail for testing
Front-end code
1 <input type = "text" name = "Mail" id = "Mail"/> 2 <span> * enter your email address </span> <br/> 3 <asp: button ID = "zhuce" runat = "server" Text = "tijiao" OnClick = "btn"/>
Background code
1 protected void btn (object sender, EventArgs e) 2 {3 string mail = Context. request ["Mail"]; 4 MailMessage message = new MailMessage (); 5 message. from = new MailAddress ("######", "#####"); // The sender address 6 message. to. add (mail); // The target sender address 7 message. subject = "dssdds"; // mail Title 8 message. body = "nihao"; // mail content 9 // smtp server address for sending mail 10 SmtpClient smtp = new SmtpClient ("smtp.163.com"); 11 smtp. credentials = new NetworkCredential ("#########", "#####"); // the sender's username and password 12 smtp. send (message); 13}