Emailing from a simple web application

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Mar 2009
Posts: 21
Reputation: .netidiot is an unknown quantity at this point 
Solved Threads: 0
.netidiot .netidiot is offline Offline
Newbie Poster

Emailing from a simple web application

 
0
  #1
Mar 31st, 2009
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
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 34
Reputation: vizy is an unknown quantity at this point 
Solved Threads: 6
vizy's Avatar
vizy vizy is offline Offline
Light Poster

Re: Emailing from a simple web application

 
0
  #2
Apr 1st, 2009
Hi,

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


  1.  
  2.  
  3. using System.Net.Mail;
  4.  
  5. MailMessage msgMail = null;
  6. MailAddress objMAddTo,objMAddFrom = null;
  7. SmtpClient objSMTP = new SmtpClient();
  8. objSMTP.Host = ""; // set your SMTP mail server.. domainname or the IP
  9.  
  10. objMAddTo = new MailAddress("admin@test.com"); //Admin details
  11. objMAddFrom = new MailAddress("user@test.com", "User"); // sender details
  12. msgMail = new MailMessage(objMAddFrom, objMAddTo);
  13. msgMail.IsBodyHtml = true; // if your Body contains HTML tags
  14. msgMail.Subject = "Report Fault Error";
  15. msgMail.Body = "Hi Admin, Error Reporting here"; //your complete email body contents here
  16. 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... >>>
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 21
Reputation: .netidiot is an unknown quantity at this point 
Solved Threads: 0
.netidiot .netidiot is offline Offline
Newbie Poster

Re: Emailing from a simple web application

 
0
  #3
Aug 15th, 2009
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'.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 457 | Replies: 2
Thread Tools Search this Thread



Tag cloud for ASP.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC