Asp. NEt Mailbox Verification Change Password Recovery Password through Mailbox Function
- 2021-10-15 10:21:50
- OfStack
Use mailbox verification to change password. Here I use 163 free mail to test
Foreground code
<input type="text" name="Mail" id="Mail"/>
<span>* Please enter the mailbox </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("######", "#####");// Sender's address
message.To.Add(mail);// Destination sending address
message.Subject = "dssdds";// Message header
message.Body = "nihao";// Mail content
// Sending mail smtp Server address
SmtpClient smtp = new SmtpClient("smtp.163.com");
smtp.Credentials = new NetworkCredential("#########", "######");// Sender's username and password
smtp.Send(message);
}
Summarize