PowerShell/Scripts/email.ps1
2020-07-28 17:56:37 +00:00

10 lines
293 B
PowerShell
Executable File

mtpServer = "smtp.example.com"
$msg = new-object Net.Mail.MailMessage
$smtp = new-object Net.Mail.SmtpClient($smtpServer)
$msg.From = "me@example.com"
$msg.ReplyTo = "me@example.com"
$msg.To.Add("you@example.com")
$msg.subject = "Test Mail"
$msg.body = "This is a test mail."
$smtp.Send($msg)