Asp.NEt Email verification, password modification, password retrieval through email

Time:2021-4-1

Use email verification to change the password, here I am using 163 free mail for testing

Front desk code

<input type="text" name="Mail"/>
     <span>*Please enter email address < / span > < br / >
     <asp:Button ID="zhuce" runat="server" Text="tijiao" OnClick="btn" />

Background code

protected void btn(object sender, EventArgs e)
    {
      string mail = Context.Request["Mail"];
      MailMessage message = new MailMessage();
      message.From  =New MailAddress ("#######################################
      message.To.Add (mail); // destination address
      message.Subject  ="Dssds"; // message title
      message.Body  ="Nihao"; // email content
      //The address of the SMTP server that sent the mail
      SmtpClient smtp = new SmtpClient("smtp.163.com");
      smtp.Credentials  =New networkcredential ("###############################################
      smtp.Send(message);
    }

summary

The above is the introduction of Xiaobian Asp.NEt Email verification to change the password, through the email to find the password function, I hope to help you, if you have any questions, please leave me a message, Xiaobian will reply to you in time. Thank you very much for your support to developer!