Email Attachment with Powershell

##Variables:
$SMTPServer = "mxserver.example.com"
$FromAddress = "[email protected]"
$ToAddress = "[email protected]"
$Subject = "Monthly Stats"
$Body = "Monthly stats attached"
##Compile SMTP message and send:
$SMTPMessage = New-Object System.Net.Mail.MailMessage $FromAddress, $ToAddress, $Subject, $Body
$Attachment = New-Object Net.Mail.Attachment("C:\Dir1\Stats.txt")
$SMTPMessage.Attachments.Add($Attachment)
$Attachment = New-Object Net.Mail.Attachment("C:\Dir2\Stats.sv")
$SMTPMessage.Attachments.Add($Attachment)
$SMTPClient = New-Object System.Net.Mail.SMTPClient $SMTPServer
$SMTPClient.Send($SMTPMessage)

Previous page: Disconnected Mailboxes
Next page: Exchange Certificate