943,807 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 768
  • ASP.NET RSS
Mar 31st, 2009
0

Emailing from a simple web application

Expand Post »
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
Reputation Points: 8
Solved Threads: 0
Newbie Poster
.netidiot is offline Offline
21 posts
since Mar 2009
Apr 1st, 2009
0

Re: Emailing from a simple web application

Hi,

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


ASP.NET Syntax (Toggle Plain Text)
  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.
Reputation Points: 10
Solved Threads: 6
Light Poster
vizy is offline Offline
36 posts
since Dec 2007
Aug 15th, 2009
0

Re: Emailing from a simple web application

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'.
Reputation Points: 8
Solved Threads: 0
Newbie Poster
.netidiot is offline Offline
21 posts
since Mar 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC