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

18.6. Putting It All Together

We have gone through quite a lot! Our simple e-mail script grew into something quite sophisticated. The final script can now do the following:

  • Send both plain text and HTML e-mail.

  • Handle multiple recipients.

  • Support carbon copying and blind carbon copying.

  • Set message priority and Reply-To address.

  • Add custom headers and support message read receipts.

  • Attach files to the message.

  • Embed media files in HTML-formatted messages.

The beauty of it all is that our script library, mailutils-final.ps1, contains less than 100 lines of script. The driver script, send-mail-final.ps1, is about 20 lines long and just calls functions from the script library. We got every feature from the preceding list for a mere 120 lines of code--talk ...

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