472,789 Members | 1,179 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,789 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 1646
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...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
How does React native implement an English player?
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.