Click here to Skip to main content
15,893,337 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to send email notification after user get registered to recieve his forget password
Posted
Comments
Sandeep Mewara 3-May-12 1:34am    
What exactly you are looking for?
1. Way to design this workflow? OR
2. How to send an email?

Use PasswordRecovery control, it is a part of Login controls and helps to recover password who have forgotten their passwords. It enables a user to request an e-mail message containing either a new password or the password already associated with his or her user name or email.
Have a look:
PasswordRecovery Control in ASP.NET[^]
Password Recovery[^]
 
Share this answer
 
v2
if you have a mail server:

C#
public bool SendEmail(string subj, string message)
       {
           bool sent = false;
           try
           {
               SmtpClient client = new SmtpClient(this.strMailServer);

               client.UseDefaultCredentials = true;
               client.DeliveryMethod = SmtpDeliveryMethod.Network;

               MailMessage email = new MailMessage();
               email.From = new MailAddress(this.strSendFrom);
               email.To.Add(new MailAddress(this.strSendTo));
               email.CC.Add(new MailAddress(this.strSendtoCC));
               email.Subject = subj;
               email.Body = message;

               client.Send(email);
               sent = true;
           }
           catch (Exception ex)
           {
               throw ex;
           }
           return sent;
       }
 
Share this answer
 
Please include namespace "using System.Net.Mail;"

and include this coding


SmtpClient smtp = new SmtpClient();
MailMessage msg = new MailMessage();
msg.From = new MailAddress("From Address");
msg.To.Add(new MailAddress("To Address"));

// Set the subject of the mail message
msg.Subject = "Your Subject";

// Set the format of the mail message body as HTML
msg.IsBodyHtml = true;

// Set the body of the mail message
msg.Body = "Your Content;

//Create host for Gmail service
smtp.Host = "smtp.gmail.com";
smtp.UseDefaultCredentials = true;

smtp.Credentials = new System.Net.NetworkCredential("From Address", " Password");
smtp.EnableSsl = true;

smtp.Send(msg);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900