While in PowerShell 2 there will be a “Send-Mail” cmdlet (as I heard), I needed something for current version. Here is the self-explaining PowerShell script for sending mails with optional attachments and multiple recipients. Remember to change the hard-coded “mail.server.com” to your own mail server, otherwise nothing will work :). ##############################################################
# Send e-mail with optional attachments
#
function SendEmail
{
param(
$From,
$To,
$Subject,
$Body,
...