powershell send mail
# Message
$message = New-Object Net.Mail.MailMessage;
$message.From = $From
$message.To = $To
$message.Subject = $Subject
$message.Body = $Body
# Attachment
$attachment = New-Object Net.Mail.Attachment($Attachment);
$message.Attachments.Add($attachment)
# SMTP
$smtp = New-Object Net.Mail.SmtpClient($SMTPServer, $SMTPPort)
$smtp.EnableSSL = $true
$smtp.Credentials = New-Object System.Net.NetworkCredential($username, $password)
# Send mail
$smtp.send($message)
# Clean up
$attachment.Dispose()
$message.Dispose()
$smtp.Dispose()