473,811 Members | 3,026 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Send email when error occurs

Hi,

My plan is to use Try Catch statements to catch an error and then email it
to myself. I send the user to a custom error page and I would like to email
myself the asp.net error. I thought that I would just call a function to
send a mail in the Catch area of the Try Catch statement but it didn't work,
or maybe I just had it set up wrong. What is the best way to accoplish this
task, using a Try Catch or something else?

Thanks.
Nov 19 '05 #1
5 1685
JV
Configuring your SMTP server may be the problem. It can be complicated.
And, there are sometimes errors created by unexpected software interactions.
I chased around quite awhile before I uncovered the fact that McAfee's
antivirus program was blocking my SMTP port for example.

I would recommend that you examine closely the error being generated when
your code tries to do the email send.

"Andy G" <aj*****@iastat e.edu> wrote in message
news:uU******** ******@TK2MSFTN GP10.phx.gbl...
Hi,

My plan is to use Try Catch statements to catch an error and then email it
to myself. I send the user to a custom error page and I would like to
email myself the asp.net error. I thought that I would just call a
function to send a mail in the Catch area of the Try Catch statement but
it didn't work, or maybe I just had it set up wrong. What is the best way
to accoplish this task, using a Try Catch or something else?

Thanks.

Nov 19 '05 #2
I can send emails fine. The system already generates a number of automatic
emails. I just need to know where to catch the error that occurs and then
send that error to to myself. I apoligize, I know I wasn't clear before.
When I say 'Error', I am talking about ANY error that might occur in the
system when a user is using it. I want to be notified right away of what is
going on.

Hopefully that helps out.
"JV" <jo**********@g oisc.com> wrote in message
news:eZ******** ******@TK2MSFTN GP14.phx.gbl...
Configuring your SMTP server may be the problem. It can be complicated.
And, there are sometimes errors created by unexpected software
interactions. I chased around quite awhile before I uncovered the fact
that McAfee's antivirus program was blocking my SMTP port for example.

I would recommend that you examine closely the error being generated when
your code tries to do the email send.

"Andy G" <aj*****@iastat e.edu> wrote in message
news:uU******** ******@TK2MSFTN GP10.phx.gbl...
Hi,

My plan is to use Try Catch statements to catch an error and then email
it to myself. I send the user to a custom error page and I would like to
email myself the asp.net error. I thought that I would just call a
function to send a mail in the Catch area of the Try Catch statement but
it didn't work, or maybe I just had it set up wrong. What is the best
way to accoplish this task, using a Try Catch or something else?

Thanks.


Nov 19 '05 #3
Did you see an error message that might indicate what the problem is?

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Fri, 18 Mar 2005 08:51:20 -0600, "Andy G" <aj*****@iastat e.edu>
wrote:
Hi,

My plan is to use Try Catch statements to catch an error and then email it
to myself. I send the user to a custom error page and I would like to email
myself the asp.net error. I thought that I would just call a function to
send a mail in the Catch area of the Try Catch statement but it didn't work,
or maybe I just had it set up wrong. What is the best way to accoplish this
task, using a Try Catch or something else?

Thanks.


Nov 19 '05 #4
Ah! In that case, you'll want to look at using the Application_Err or
method in global.asax. This method fires when the HttpApplication
object raises an Error event.

There are some good articles around the topic of error logging using
Application_Err or demonstrating how to get the last exception,
emailing a stack trace, etc.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Fri, 18 Mar 2005 09:14:29 -0600, "Andy G" <aj*****@iastat e.edu>
wrote:
I can send emails fine. The system already generates a number of automatic
emails. I just need to know where to catch the error that occurs and then
send that error to to myself. I apoligize, I know I wasn't clear before.
When I say 'Error', I am talking about ANY error that might occur in the
system when a user is using it. I want to be notified right away of what is
going on.

Hopefully that helps out.
"JV" <jo**********@g oisc.com> wrote in message
news:eZ******* *******@TK2MSFT NGP14.phx.gbl.. .
Configuring your SMTP server may be the problem. It can be complicated.
And, there are sometimes errors created by unexpected software
interactions. I chased around quite awhile before I uncovered the fact
that McAfee's antivirus program was blocking my SMTP port for example.

I would recommend that you examine closely the error being generated when
your code tries to do the email send.

"Andy G" <aj*****@iastat e.edu> wrote in message
news:uU******** ******@TK2MSFTN GP10.phx.gbl...
Hi,

My plan is to use Try Catch statements to catch an error and then email
it to myself. I send the user to a custom error page and I would like to
email myself the asp.net error. I thought that I would just call a
function to send a mail in the Catch area of the Try Catch statement but
it didn't work, or maybe I just had it set up wrong. What is the best
way to accoplish this task, using a Try Catch or something else?

Thanks.



Nov 19 '05 #5
Thanks Scott, I will look for some articles on the Application_Err or.
"Scott Allen" <sc***@nospam.o detocode.com> wrote in message
news:pg******** *************** *********@4ax.c om...
Ah! In that case, you'll want to look at using the Application_Err or
method in global.asax. This method fires when the HttpApplication
object raises an Error event.

There are some good articles around the topic of error logging using
Application_Err or demonstrating how to get the last exception,
emailing a stack trace, etc.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Fri, 18 Mar 2005 09:14:29 -0600, "Andy G" <aj*****@iastat e.edu>
wrote:
I can send emails fine. The system already generates a number of
automatic
emails. I just need to know where to catch the error that occurs and then
send that error to to myself. I apoligize, I know I wasn't clear before.
When I say 'Error', I am talking about ANY error that might occur in the
system when a user is using it. I want to be notified right away of what
is
going on.

Hopefully that helps out.
"JV" <jo**********@g oisc.com> wrote in message
news:eZ****** ********@TK2MSF TNGP14.phx.gbl. ..
Configuring your SMTP server may be the problem. It can be complicated.
And, there are sometimes errors created by unexpected software
interactions. I chased around quite awhile before I uncovered the fact
that McAfee's antivirus program was blocking my SMTP port for example.

I would recommend that you examine closely the error being generated
when
your code tries to do the email send.

"Andy G" <aj*****@iastat e.edu> wrote in message
news:uU******** ******@TK2MSFTN GP10.phx.gbl...
Hi,

My plan is to use Try Catch statements to catch an error and then email
it to myself. I send the user to a custom error page and I would like
to
email myself the asp.net error. I thought that I would just call a
function to send a mail in the Catch area of the Try Catch statement
but
it didn't work, or maybe I just had it set up wrong. What is the best
way to accoplish this task, using a Try Catch or something else?

Thanks.

Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3058
by: Paul | last post by:
I am using a windows service which accesses Microsoft Outlook. Outlook is supposed to send an email. This works fine when not run in a windows service. I am running the service under my user domain logon. I am using VB.net and using redemption.dll to bypass the security patch. This is the line of code that causes the event error Dim olApp As New Outlook.Application When I try and use a service the following error occurs.
11
6528
by: Mohammed Abdel-Razzak | last post by:
dear sirs i want to send email using c# but i don`t want to use CDONTS or tell me how can i use it i don`t know any thing about CDONTS thanks
13
8110
by: Manfred Braun | last post by:
Hi All, I am trying to understand the blocking method socket.Send(). The call blocks as expected, but does this mean, it returnes after the underlying TCP layer got a confirmation, that the send data was received by the socket on the remote end? Can I count on that? Do I understand TCP correctly in that, it gives confirmation ? I do not expect, that a .Net based receiver got that data when socket.Send() terminates!
2
2343
by: Ron | last post by:
hi guys, I am trying to send email using smtpMail. I can send emails inside the organization, but out of the organization I get an error "The server rejected one or more recipient addresses. The server response was: 550 5.7.1 Unable to relay for ........" now I tried to add username and password for the server to relay but it is still not working. this is the example i used:
0
903
by: Jeff Levinson [mcsd] | last post by:
Your best bet instead of re-coding all of it is to use the Exception Handling Application Block. You can find it on the MSDN website by searching for Application Blocks. If you don't want to do that, you'll need to reference the System.Web assembly and import the System.Web.Mail namespace and then you can send mail from a .NET winform. However, be warned that you need to have SMTP installed and running on the users machine so depending...
0
1879
by: jj | last post by:
Hi With the code below I want to send an email when a certain situation occurs. When I does this from my own computer at home it works very well - but when I try to use it from a company I get the following error: "Run-time error '2147220973 (80040213)' : The transport failed to connect to the server. I am pretty sure I have used the right smtpserver for the company. Anyone knows what could be the problem, and how I could correct it? ...
5
4101
by: pat | last post by:
Hi, i'am using an ac2K progrom which sends automaticle emails with an attachment. Since last week , a error occurs with number 2293. Our mail program is Outlook 2003. It's probably a matter of safety in outlook, but i didn't saw an answer to prevent this error on theweb. Where can i configure the safetyitem that Outlook sees the mail not langer
6
4497
Carrugar
by: Carrugar | last post by:
I'm running IIS 6.0 on a Win2003 server. One web page is trying to use the new CDO method of sending e-mail but generates the following error: CDO.Message.1 error '80070005' Access is denied. Code: <%
0
783
by: Anjan Bhowmik | last post by:
Hi, I want to be able to send an email to my account whenever an error/exception occurs, including compiler errors to my email. Where to catch the exception/errors in application level, so that i can send the message via email? Thnx in advance.
0
9727
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9605
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10647
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10386
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10133
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7669
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6889
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5554
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5692
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.