Skip to content

Instantly share code, notes, and snippets.

@royashbrook
Created February 7, 2018 16:18
Show Gist options
  • Save royashbrook/5b540530e77a5dc2990f5fa1aabb9c3c to your computer and use it in GitHub Desktop.
Save royashbrook/5b540530e77a5dc2990f5fa1aabb9c3c to your computer and use it in GitHub Desktop.
## Send me an email
Send-MailMessage `
-From "name <[email protected]>" `
-To @("me <[email protected]>") `
-Attachments $fi.FullName `
-SmtpServer "10.10.10.10" `
-Port 25 `
-Subject "Subject" `
-Body "PFA File: $($fi.Name)"
## Add more emails if desired, $fi is a file from get-item, can change it:
$fn = "file path"
if (Test-Path $fn){
$fi = Get-Item $fn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment