O'Reilly logo

Programming Windows® Services with Microsoft® Visual Basic® 2008 by Michael Gernaey

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Service Notification

Although putting an entry in the Application log may suffice, you might be required at times to also send a notification when a problem is found and a process has been terminated. In this last section we will implement the code necessary to send an e-mail alert when a process is terminated.

Updating the Configuration.xml File

Example 8-16 represents the changes required to our configuration file so that the code will send an administrative alert.

Example 8-16. E-mail configuration elements.

<SmtpServer>smtpserver</SmtpServer> <Subject>Test Subject</Subject> <Message>Found Message</Message> <Sender>Michael.E.Gernaey@test.com</Sender> <Recipient>Michael.E.Gernaey@test.com</Recipient> <SmtpPort>25</SmtpPort> <MailEnabled>true</MailEnabled> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required