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> ...

Get Programming Windows® Services with Microsoft® Visual Basic® 2008 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.