Click here to Skip to main content
15,895,084 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all,

in my project i need one help.please suggest me.

project contains all the employee information pages i.e personal,emergency,skills,work experience etc....

what i need to do is if any employee updates any data in that pages mail should be triggered to my hr manager.in what way i need to write the logic.

please do help me. :)
Posted
Comments
shakil0304003 11-Feb-11 6:48am    
What you tried?
mandarapu 11-Feb-11 6:59am    
i think of creating a mail method.can u tell by any code with example.
Manas Bhardwaj 11-Feb-11 7:12am    
no effort

Create a method to send email to hr with Employees details who have updates.
Call that in every page for updates made by the employees.

[Update]
Send Email in ASP.Net[^]

For suppose you are updating the employee contact details
C#
private void btnUpdate_Click(object sender, System.EventArgs e)
{
  //code to update your employees details.
  // call the sendemail() here
  SendEmail();
}
public void SendEmail()
{
 //code to send email.

}

[/Update]
 
Share this answer
 
v2
Comments
mandarapu 11-Feb-11 6:57am    
can u please explain with sample code.what their requirement is email used go after their updated.
m@dhu 11-Feb-11 7:07am    
Check my updated answer.
You can use it
public static class MailUtility
{
    public static void SendEmail(string sender, string receiver, string subject, string body)
    {
        MailMessage message = new MailMessage();
        message.From = new System.Net.Mail.MailAddress(sender, "ADMIN");
        message.To.Add(receiver);
        message.IsBodyHtml = true;

        message.Body = body;
        message.Subject = subject;

        SmtpClient smtp = new SmtpClient();
        try
        {
            smtp.Send(message);
        }
        catch (Exception)
        {

        }

        message = null;
    }
}
 
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