Created
February 7, 2018 16:18
-
-
Save royashbrook/5b540530e77a5dc2990f5fa1aabb9c3c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 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