0

Hi,

I have to send a notification to my clients using a email template. For eg if i have updated some data a notification should be send to them that some updates have done. So how can i do that? Please help me out its very urgent.

2
Contributors
3
Replies
6
Views
6 Years
Discussion Span
Last Post by jugosoft
0

Every time you update database with some data, send new e-mail:

try
            {
                MailMessage mail = new MailMessage();
                SmtpClient SmtpServer = new SmtpClient("smtpServer");

                mail.From = new MailAddress("");
                mail.To.Add("");
                mail.Subject = "";
                mail.Body = "";

                SmtpServer.Port = 587;
                SmtpServer.Credentials = new System.Net.NetworkCredential("username", "password");
                SmtpServer.EnableSsl = true;

                SmtpServer.Send(mail);
            }
            catch (Exception ex)
            {
// Redirect to error page
            }
0

Hi jugosoft,

Thanks for your reply. actually i'm doing a recruitment service. So there are different users. For example if A is logging in and raising a request it should be send to B. And b after accomplishing that request should send to B and C. So is this code working in that way. Please reply.

0

That code is for sending mail. You can have collumns for receivers of mail or you can have one collumn with data that are splited with eg. ';'. You also need a collumn that constains if mail was sent to A, B, C....

This is combination of simple reading data from database and mail sending.

To check if mail was sent to eg. 'A' > 'B' use 'if' statement.

Edited by jugosoft: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.