473,386 Members | 1,908 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,386 software developers and data experts.

Emailing Errors from Pages

I am trying to get my "Global.asax" error handling event to email me
an error description. I believe I have the SMTP code correct and
pointing it to my company's Exchange Server. I still fail to get my
"localhost" installation of my app to send emails. I have checked in
MMC to see that the Default SMTP server is running on my box. I have
not entered any configs into that.

Any tips?

Brian

Here is what I have coded in Global.asax :
Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
' Fires when an error occurs
' Brian
' 04/14/2004
Try
Mail.SmtpMail.SmtpServer = "our.exchange.server"
Dim mlMessage As Mail.MailMessage = New Mail.MailMessage
mlMessage.Body =
HttpContext.Current.Server.GetLastError().ToString ()
mlMessage.To = "on****@advancetechnology.com"
mlMessage.From = "WebUser"
mlMessage.Subject = "Error"
Call Mail.SmtpMail.Send(mlMessage)

Catch ERR As System.Exception
' Just ignore it at this point.
End Try
End Sub
Nov 18 '05 #1
4 1001
what is the error

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Brian" <bo***@vafb.com> wrote in message
news:d2**************************@posting.google.c om...
I am trying to get my "Global.asax" error handling event to email me
an error description. I believe I have the SMTP code correct and
pointing it to my company's Exchange Server. I still fail to get my
"localhost" installation of my app to send emails. I have checked in
MMC to see that the Default SMTP server is running on my box. I have
not entered any configs into that.

Any tips?

Brian

Here is what I have coded in Global.asax :
Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
' Fires when an error occurs
' Brian
' 04/14/2004
Try
Mail.SmtpMail.SmtpServer = "our.exchange.server"
Dim mlMessage As Mail.MailMessage = New Mail.MailMessage
mlMessage.Body =
HttpContext.Current.Server.GetLastError().ToString ()
mlMessage.To = "on****@advancetechnology.com"
mlMessage.From = "WebUser"
mlMessage.Subject = "Error"
Call Mail.SmtpMail.Send(mlMessage)

Catch ERR As System.Exception
' Just ignore it at this point.
End Try
End Sub

Nov 18 '05 #2
Error occurs at line :
Call Mail.SmtpMail.Send(mlMessage)

And is phrased :
System.Web.HttpException: Could not access 'CDO.Message' object.

"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message news:<Od*************@TK2MSFTNGP11.phx.gbl>...
what is the error

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Brian" <bo***@vafb.com> wrote in message
news:d2**************************@posting.google.c om...
I am trying to get my "Global.asax" error handling event to email me
an error description. I believe I have the SMTP code correct and
pointing it to my company's Exchange Server. I still fail to get my
"localhost" installation of my app to send emails. I have checked in
MMC to see that the Default SMTP server is running on my box. I have
not entered any configs into that.

Any tips?

Brian

Here is what I have coded in Global.asax :
Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
' Fires when an error occurs
' Brian
' 04/14/2004
Try
Mail.SmtpMail.SmtpServer = "our.exchange.server"
Dim mlMessage As Mail.MailMessage = New Mail.MailMessage
mlMessage.Body =
HttpContext.Current.Server.GetLastError().ToString ()
mlMessage.To = "on****@advancetechnology.com"
mlMessage.From = "WebUser"
mlMessage.Subject = "Error"
Call Mail.SmtpMail.Send(mlMessage)

Catch ERR As System.Exception
' Just ignore it at this point.
End Try
End Sub

Nov 18 '05 #3
please make sure you have the cdo dll installed on the server. if it is, you
will need to re-register it at the command line using the regsvr32 utility

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Brian" <bo***@vafb.com> wrote in message
news:d2**************************@posting.google.c om...
Error occurs at line :
Call Mail.SmtpMail.Send(mlMessage)

And is phrased :
System.Web.HttpException: Could not access 'CDO.Message' object.

"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
news:<Od*************@TK2MSFTNGP11.phx.gbl>...
what is the error

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Brian" <bo***@vafb.com> wrote in message
news:d2**************************@posting.google.c om...
>I am trying to get my "Global.asax" error handling event to email me
> an error description. I believe I have the SMTP code correct and
> pointing it to my company's Exchange Server. I still fail to get my
> "localhost" installation of my app to send emails. I have checked in
> MMC to see that the Default SMTP server is running on my box. I have
> not entered any configs into that.
>
> Any tips?
>
> Brian
>
> Here is what I have coded in Global.asax :
> Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
> ' Fires when an error occurs
> ' Brian
> ' 04/14/2004
> Try
> Mail.SmtpMail.SmtpServer = "our.exchange.server"
> Dim mlMessage As Mail.MailMessage = New Mail.MailMessage
> mlMessage.Body =
> HttpContext.Current.Server.GetLastError().ToString ()
> mlMessage.To = "on****@advancetechnology.com"
> mlMessage.From = "WebUser"
> mlMessage.Subject = "Error"
> Call Mail.SmtpMail.Send(mlMessage)
>
> Catch ERR As System.Exception
> ' Just ignore it at this point.
> End Try
> End Sub

Nov 18 '05 #4
Check the InnerException and InnerException's InnerException property. They
can be nested two or three deep. The innermost exception has the actual
error message that caused the problem.

Eric
"Brian" <bo***@vafb.com> wrote in message
news:d2**************************@posting.google.c om...
Error occurs at line :
Call Mail.SmtpMail.Send(mlMessage)

And is phrased :
System.Web.HttpException: Could not access 'CDO.Message' object.

"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message

news:<Od*************@TK2MSFTNGP11.phx.gbl>...
what is the error

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Brian" <bo***@vafb.com> wrote in message
news:d2**************************@posting.google.c om...
I am trying to get my "Global.asax" error handling event to email me
an error description. I believe I have the SMTP code correct and
pointing it to my company's Exchange Server. I still fail to get my
"localhost" installation of my app to send emails. I have checked in
MMC to see that the Default SMTP server is running on my box. I have
not entered any configs into that.

Any tips?

Brian

Here is what I have coded in Global.asax :
Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
' Fires when an error occurs
' Brian
' 04/14/2004
Try
Mail.SmtpMail.SmtpServer = "our.exchange.server"
Dim mlMessage As Mail.MailMessage = New Mail.MailMessage
mlMessage.Body =
HttpContext.Current.Server.GetLastError().ToString ()
mlMessage.To = "on****@advancetechnology.com"
mlMessage.From = "WebUser"
mlMessage.Subject = "Error"
Call Mail.SmtpMail.Send(mlMessage)

Catch ERR As System.Exception
' Just ignore it at this point.
End Try
End Sub

Nov 18 '05 #5

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

Similar topics

0
by: Jonathan M. Rose | last post by:
I am looking for a script that I can sit on an HTML server (Linux, Apache, PHP/Perl/Python/Etc.) that will allow me to do the following things: 1) Post news articles that consists of (i) a title...
2
by: Paul Hudson | last post by:
Ive developed a web based system where somebody can add a news record using ASP and MS Access database connectivity. The new record is inserted into the database and then a formatted email gets...
10
by: MLH | last post by:
I print to a device that creates a PDF. Knowing the filename, how can I then embed the PDF into the body text of an OutLook Express outbound email & send to a specified address in a table? I want...
1
by: Bill | last post by:
Using A2K. Is it possible to email separate pages of a report to separate recipients? I am generating a student report for 500 individual students which I have usually printed off, one page per...
5
by: Colin Anderson | last post by:
I discovered, with great excitement, this article http://www.davison.uk.net/vb2notes.asp when researching methods for emailing from Access via Notes. Unfortunatly, when I run this I get a...
30
by: Dave | last post by:
Hi, I have found some code on the Microsoft knowledge base that 'should' allow me to send emails and attachments However the code tries to use Outlook and i want it to use outlook Express ...
3
by: tafs7 | last post by:
My code below is supposed to email me when an error occurs on the application, but it's not emailing anything. Am I missing something? I know the smtp servers I've tried work. I even added a...
4
by: Mike Moore | last post by:
What is the best way to launch outlook from an asp.net web page? Can you do this using MAPI or is there a control that you can purchase? We are unable to use SMTP. We use MS Exhange and MAPI...
1
by: bobh | last post by:
Hi All, I've been using this function which I got from here for some time now in two of my AccessXP multiusers applications and it has worked without issue until lately it has stopped functioning...
6
by: John | last post by:
Hi I would like to be able to log as much info as possible about an error in my app and the critical ones to be emailed to me. Is there a pre-built library/control that would do that? Many...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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,...
0
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...
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...

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.