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

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);

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'.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.