O'Reilly logo

Pro Windows PowerShell by Hristo Deshev

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

Chapter 18. Sending E-mail

All types of system automation will sooner or later have to deal with e-mail. Long running processes often call home when they are finished. Complex operations complete by sending their execution log to a central place. Failures and special conditions that require user actions usually distribute notifications via e-mail to all interested parties. Unlike some automation environments, PowerShell does not provide a built-in facility that sends e-mail. This may seem like a big omission at first, but things get a lot better when we examine the alternatives. The Microsoft.NET framework 2.0 already provides excellent support for sending SMTP mail with its System.Net.Mail classes, and we will use those to build a script that ...

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