SHARE
TWEET

Untitled

a guest Jul 19th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $Directory=Get-ChildItem "C:Reports" -Directory
  2. $Cred = Get-Credential
  3. Foreach($d in $Directory) {
  4. Write-Host "Working on directory $($d.FullName)..."
  5. $files=Get-ChildItem -Path "$($d.FullName)"
  6. cd $d.Fullname  
  7. Send-MailMessage -From "vallabhherlekar@gmail.com" -To "vallabhherlekar@gmail.com" -Subject "test" -SmtpServer "smtp.gmail.com" -Port "587" -Attachments $files -BodyAsHtml "test msg" -Credential $Cred -UseSsl
  8. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top