RosettaCodeData/Task/Send-email/PowerShell/send-email.ps1

15 lines
380 B
PowerShell
Raw Permalink Normal View History

2026-04-30 12:34:36 -04:00
[hashtable]$mailMessage = @{
From = "weirdBoy@gmail.com"
To = "anudderBoy@YourDomain.com"
Cc = "daWaghBoss@YourDomain.com"
Attachment = "C:\temp\Waggghhhh!_plan.txt"
Subject = "Waggghhhh!"
Body = "Wagggghhhhhh!"
SMTPServer = "smtp.gmail.com"
SMTPPort = "587"
UseSsl = $true
ErrorAction = "SilentlyContinue"
}
Send-MailMessage @mailMessage