Guest User

Untitled

a guest
Feb 20th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. ## Send me an email
  2. Send-MailMessage `
  3. -From "name <emailaddress@domain.com>" `
  4. -To @("me <myemailaddress@domain.com>") `
  5. -Attachments $fi.FullName `
  6. -SmtpServer "10.10.10.10" `
  7. -Port 25 `
  8. -Subject "Subject" `
  9. -Body "PFA File: $($fi.Name)"
  10.  
  11. ## Add more emails if desired, $fi is a file from get-item, can change it:
  12. $fn = "file path"
  13. if (Test-Path $fn){
  14. $fi = Get-Item $fn
Add Comment
Please, Sign In to add comment