0

Hi, i am developing a simple web application for fault reporting. Users log into the system and report a fault which is then added to a database. I want to be able to email the system administrator a log file containing the information which has been added to the database. Any help on what i need to look at would be much appreciated.thanks

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by .netidiot
0

Hi,

Here is the way. u can send mail to admin, while entering the data into DB

using System.Net.Mail;

                MailMessage msgMail = null;                
                MailAddress objMAddTo,objMAddFrom = null;
                SmtpClient objSMTP = new SmtpClient();
                objSMTP.Host = ""; // set your SMTP mail server.. domainname or the IP

                     objMAddTo = new MailAddress("admin@test.com"); //Admin details
                     objMAddFrom = new MailAddress("user@test.com", "User"); // sender details
                     msgMail = new MailMessage(objMAddFrom, objMAddTo);
                    msgMail.IsBodyHtml = true; // if your Body contains HTML tags
                    msgMail.Subject = "Report Fault Error";
                    msgMail.Body = "Hi Admin,  Error Reporting here"; //your complete email body contents here
                    objSMTP.Send(msgMail);
0

Hi ill post the current error I am getting having implemented the code incase i am unable to solve in myself.


Callbacks are not supported on CommandField when the select button is enabled because other controls on your page that are dependent on the selected value of 'GridView1' for their rendering will not update in a callback. Turn callbacks off on 'GridView1'.

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.