For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic > March 2006 > Writing an e-mail in code









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Writing an e-mail in code
Sheldon

2006-03-29, 6:56 pm

I am using VB6 and have several programs running unattended (no forms, no
user interaction). How do I send an email when (if) the program encounters
an error that forces abnormal termination?

Thanks

Sheldon
Jeff Johnson [MVP: VB]

2006-03-29, 6:56 pm


"Sheldon" <Sheldon@discussions.microsoft.com> wrote in message
news:917DE4C8-7488-448A-9AAE-FD3591D9910F@microsoft.com...

>I am using VB6 and have several programs running unattended (no forms, no
> user interaction). How do I send an email when (if) the program
> encounters
> an error that forces abnormal termination?


If by "abnormal termination" you mean that the program detects what it
considers a fatal error and shuts itself down, then you would send email
like you would any other time. I recommend looking into the CDO library.

If you mean "user uses Task Manager to end your program's process" then
there's nothing you can do about that.


Ralph

2006-03-29, 6:56 pm


"Sheldon" <Sheldon@discussions.microsoft.com> wrote in message
news:917DE4C8-7488-448A-9AAE-FD3591D9910F@microsoft.com...
> I am using VB6 and have several programs running unattended (no forms, no
> user interaction). How do I send an email when (if) the program

encounters
> an error that forces abnormal termination?
>
> Thanks
>
> Sheldon


The key here is "abnormal termination" - if it something the app can detect,
as Jeff noted, as something "that might happen" then OK. But if things are
truly out-of-control - attempting to spawn, shell or load something else -
may not be possible.

You may need to take a look at some sort of WatchDog Timer.

-ralph


Nobody

2006-03-30, 6:56 pm

If it is something you can catch in your error handler, then maybe use
vbSendMail. I use it
for something similar to this.

"Sheldon" <Sheldon@discussions.microsoft.com> wrote in message
news:917DE4C8-7488-448A-9AAE-FD3591D9910F@microsoft.com...
>I am using VB6 and have several programs running unattended (no forms, no
> user interaction). How do I send an email when (if) the program
> encounters
> an error that forces abnormal termination?
>
> Thanks
>
> Sheldon



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com