protected void SendForgotPasswordEmail()
{
SmtpClient smtpClient = new SmtpClient();
MailMessage message = new MailMessage();
//Prepare email address
MailAddress fromAddress = new MailAddress("no-reply@test.org", "Email Name");
MailAddress toAddress = new MailAddress(HttpUtility.HtmlEncode(txtEmail.Text));
//Prepare the main message
message.From = fromAddress;
message.To.Add(toAddress);
message.Subject = "Subject Title";
message.IsBodyHtml = true;
message.Body = "<html><head><title>" + "</title></head><body>" + "<p>" + "<span style=\"font-size: 16px; color: #0c9b19; font-family: Arial\"><b>Reset Your Password</b><font face='arial' color='#666666'>" + "<br /><br />" + "<span style=\"font-size: 14px; color: #006da5; font-family: Arial\"><b>Your Email: </b><font face='arial' color='#666666'>" + HttpUtility.HtmlEncode(txtEmail.Text) + "<br />" + "<span style=\"font-size: 14px; color: #006da5; font-family: Arial\"><b>Your Username: </b><font face='arial' color='#666666'>" + HttpUtility.HtmlEncode(hf_users_id.Value) + "<br />" + "<span style=\"font-size: 12px; font-style: italic; color: #de1919; font-family: Arial\"><br /><br />" + "<a " + "<span style=\"font-size: 12px; font-style: italic; color: #de1919; font-family: Arial\"><br /><br />" + "** Passwords are unretrievable. Please make sure that you remember your password or store it in a safe place. **" + "</body></html>";
smtpClient.Host = "mail.test.org";
smtpClient.Send(message);
}
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE