I have a service that will periodically send email messages to system
adminstrators. I would like for this service to send a email notification
whenever the service is started and when it is stopped. I placed attempted
to do that from the OnStart event procedure... but any messages sent during
the OnStart procedure are not sent. But when the service is stopped, the
email messages from both the OnStart and OnStop event procedure are sent.
How can I send email messages from a service when it starts successfully?
Apparently the OnStart event procedure is not the place to do it. I looked
at the ServiceBase class and didn't see any other events or methods that
would apparently do what I need.
Thanks!