| | |
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
Views: 457 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for ASP.NET
.net 2.0 activexcontrol advice ajax alltypeofvideos anathor asp asp.net bc30451 bottomasp.net browser button c# c#gridviewcolumn checkbox child click commonfunctions compatible confirmationcodegeneration content contenttype courier css database datagridview datagridviewcheckbox datalist deadlock development dgv dropdown dropdownlist edit expose feedback flash flv form formatdecimal forms formview google grid gridview homeedition hosting iframe iis index javascript jquery list login menu microsoft migration mono mssql multistepregistration numerical object objects order panelmasterpagebuttoncontrols problem project ratings refer rotatepage save schoolproject search security serializesmo.table session silverlight smartcard sqlserver2005 suse textbox tracking typeof unauthorized update validation vb.net video view virtualdirectory vista visual-studio visualstudio web webarchitecture webdevelopemnt webservice xml youareanotmemberofthedebuggerusers





