| | |
Emailing from a simple web application
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Mar 2009
Posts: 21
Reputation:
Solved Threads: 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
Hi,
Here is the way. u can send mail to admin, while entering the data into DB
Here is the way. u can send mail to admin, while entering the data into DB
ASP.NET Syntax (Toggle Plain Text)
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);
Last edited by peter_budo; Apr 1st, 2009 at 4:38 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Njoy koding... >>>
•
•
Join Date: Mar 2009
Posts: 21
Reputation:
Solved Threads: 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'.
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'.
![]() |
Other Threads in the ASP.NET Forum
| Thread Tools | Search this Thread |
Tag cloud for ASP.NET
.net 2.0 3.5 ajax appliances application asp asp.net beginner box browser businesslogiclayer button c# cac checkbox child class compatible content contenttype control countryselector courier dataaccesslayer database datagrid datagridview datalist deployment development dgv dialog dropdownmenu dynamic dynamically edit embeddingactivexcontrol feedback fileuploader fill findcontrol flash flv form gridview gudi iis image javascript list listbox maps menu mobile mouse mssql nameisnotdeclared news novell opera order parent problem radio ratings redirect registration relationaldatabases reportemail schoolproject search security select serializesmo.table sessionvariables silverlight smoobjects software sql sql-server ssl tracking treeview typeof validatedate validation vb.net videos vista visual-studio visualstudio vs2008 web webapplications webarchitecture webdevelopment webprogramming wizard xsl





