Email Error Messages Asp.net
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up ASP.NET - Send e-mail whenever an exception occurs up vote 4 down vote favorite Hi and thanks for taking the time to answer my question. I have an asp.net webforms application that I built for internal purposes of a medium sized company. First off let me say that I handle all exceptions that might happen during CRUD operations and show the appropriate message to the user. However, is there a way that I can, in a centralised manner, first email the innerException message to myself along with the stack trace, and then show the message to the user? In other words, I dont want to create a method like EmailException() and call it in every catch(Exception ex) block but I'd like to call it once somewhere where all exceptions are first caught. If my question is not clear enough please tell me. Thanks again! c# asp.net exception-handling share|improve this question asked Dec 12 '12 at 17:47 Dragan 94442444 2 This is older than dirt at this point, but probably still makes a passable starting point: developer.com/net/asp/article.php/961301/… –Donnie Dec 12 '12 at 17:51 add a comment| 2 Answers 2 active oldest votes up vote 1 down vote accepted Elmah is perfect for this: Logging of nearly all unhandled exceptions. A web page to remotely view the entire log of recoded exceptions. A web page to remotely view the full details of any one logged exception, including colored stack traces. *In many cases, you can review the original yellow screen of death that ASP.NET generated for a given exception, even with customErrors mode turned off. An e-mail notification of each error at the time it occurs. An RSS feed of the last 15 errors from the log. Here's a config example. share|improve this answer answered Dec 12 '12 at 17:51 Michael Haren 59.3k33133190 yes i'm looking the the elmah page. However, this only handles unhandled exceptions. I handle the exceptions that occur from CRUD operations and print in a label msgs such as "Problem occurred while adding a new Project. The admin will be notified of this problem." This means that I handle these exceptions. What will the users see if I left
Latest Articles Latest Tips/Tricks Top Articles Beginner Articles Technical Blogs Posting/Update Guidelines Article Help Forum Article Competition Submit an article or tip Post your Blog quick answersQ&A Ask a Question View Unanswered Questions View All Questions... C# questions Linux questions ASP.NET questions SQL questions VB.NET questions discussionsforums All Message Boards... Application Lifecycle> Running a Business Sales / Marketing Collaboration / Beta Testing Work Issues Design and Architecture ASP.NET JavaScript C / C++ / MFC> ATL / WTL / STL Managed C++/CLI C# Free Tools Objective-C and Swift Database Hardware & Devices> System Admin Hosting and Servers Java .NET Framework Android http://stackoverflow.com/questions/13845616/asp-net-send-e-mail-whenever-an-exception-occurs iOS Mobile SharePoint Silverlight / WPF Visual Basic Web Development Site Bugs / Suggestions Spam and Abuse Watch features Competitions News The Insider Newsletter The Daily Build Newsletter Newsletter archive Surveys Product Showcase Research Library CodeProject Stuff communitylounge Who's Who Most Valuable Professionals The Lounge The Insider News The Weird & The Wonderful The Soapbox Press Releases Non-English Language > General Indian Topics General Chinese Topics help What http://www.codeproject.com/Tips/259139/Send-ASP-NET-formatted-errors-details-via-Email is 'CodeProject'? General FAQ Ask a Question Bugs and Suggestions Article Help Forum Site Map Advertise with us About our Advertising Employment Opportunities About Us Articles » Web Development » ASP.NET » General Tip/TrickBrowse CodeStatsRevisions (8)Alternatives (1) Comments (17) Add your ownalternative version Tagged as ASP.NET Stats 46.8K views21 bookmarked Posted 23 Sep 2011 Send ASP.NET formatted exception details via email Mohammad A Rahman, 9 Oct 2011 CPOL 4.95 (13 votes) 1 2 3 4 5 4.95/5 - 13 votesμ 4.95, σa 1.05 [?] Rate this: Please Sign up or sign in to vote. How to send ASP.NET formatted exception details via email Managing Exception/Error is a common task in any application. In ASP.NET, there are many ways to handle those errors or exceptions, for example, when an error or exception occurrs in an ASP.NET application, the system is going to send a formatted error message to specified developers or teams mentioned in the email list. The difference will be the body of the email will contain exactly the same formatted error as the ASP.NET generated one to display the error or exception details when occurred. For example, But when an ASP.NET application goes into life, the user should not h
Websites Community Support ASP.NET Community Standup ForumsHelp Web Forms:Guidance Videos Samples Forum Books Open Source Getting Started Getting StartedGetting Started with ASP.NET 4.5 Web Forms and https://www.asp.net/web-forms/overview/getting-started/getting-started-with-aspnet-45-web-forms/aspnet-error-handling Visual Studio 20131. Getting Started with Web Forms and Visual Studio2. Create the Project3. Create the Data Access Layer4. UI and Navigation5. Display Data Items and Details6. Shopping Cart7. Checkout and Payment with PayPal8. Membership and Administration9. URL Routing10. ASP.NET Error HandlingIntroduction to ASP.NET Web FormsCreating a Basic Web Forms Page in Visual Studio 2013Creating ASP.NET Web Projects in Visual Studio email error 2013Code Editing ASP.NET Web Forms in Visual Studio 2013ASP.NET Scaffolding in Visual Studio 2013ASP.NET Web Forms (dotnetConf 2014)Using Page Inspector for Visual Studio 2012 in ASP.NET Web FormsVisual Studio 2012 Hands On LabsWhat's New in ASP.NET and Web Development in Visual Studio 2012What's New in Web Forms in ASP.NET 4.5Using Page Inspector in Visual Studio 2012Monitoring and TelemetryRoutingASP.NET 4 - RoutingASP.NET 4 email error messages - Defining RoutesASP.NET 4 - Constructing URLs from RoutesASP.NET 4 - Accessing URL Parameters in a PageJavaScript and Client FrameworksASP.NET 4 - Microsoft Ajax OverviewASP.NET AJAX Control Toolkit (maintained by DevExpress)Working with Data Getting Started with ASP.NET 4.5 Web FormsModel Binding and Web Forms in Visual Studio 20131. Retrieving and Displaying Data2. Updating, Deleting, and Creating Data3. Sorting, Paging, and Filtering Data4. Integrating JQuery UI Datepicker5. Using Query String Values to Filter Data6. Adding Business Logic LayerASP.NET 4 Web Forms - Validating User Input in a PageASP.NET 4 Web Forms - State ManagementASP.NET Data Access - Recommended ResourcesServer Data ControlsASP.NET 4 Data-Bound ControlsASP.NET 4 Data Source Controls OverviewASP.NET 4.5 Chart ControlRecommended Resources for ASP.NET Data AccessSecurity, Authentication, and Authorization Getting Started with ASP.NET 4.5 Web FormsASP.NET IdentityCreate a secure ASP.NET Web Forms app with user registration, email confirmation and password reset (C#)Create an ASP.NET Web Forms app with SMS Two-Factor Authentication (C#)OWIN and KatanaPerformanceUsing Asynchronous Methods in ASP.NET 4.5[Build 2014] Deep Dive: Improving Performance in Your ASP.NET App (Levi Broderick)ASP.NET 4 - Web Forms Performance OverviewASP.NET 4 - Web Forms Caching OverviewASP.NET