473,394 Members | 1,774 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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 1666
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*****@iastate.edu> wrote in message
news:uU**************@TK2MSFTNGP10.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**********@goisc.com> wrote in message
news:eZ**************@TK2MSFTNGP14.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*****@iastate.edu> wrote in message
news:uU**************@TK2MSFTNGP10.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*****@iastate.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_Error
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_Error 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*****@iastate.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**********@goisc.com> wrote in message
news:eZ**************@TK2MSFTNGP14.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*****@iastate.edu> wrote in message
news:uU**************@TK2MSFTNGP10.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_Error.
"Scott Allen" <sc***@nospam.odetocode.com> wrote in message
news:pg********************************@4ax.com...
Ah! In that case, you'll want to look at using the Application_Error
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_Error 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*****@iastate.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**********@goisc.com> wrote in message
news:eZ**************@TK2MSFTNGP14.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*****@iastate.edu> wrote in message
news:uU**************@TK2MSFTNGP10.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
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...
11
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
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...
2
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...
0
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...
0
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...
5
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...
6
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. ...
0
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...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.