Email yourself a list of files (docs, mp3's, videos, whatever)



  • This command will run the Powershell script below that emails you list of documents in your profile folder (c:\users[username]):

    powershell -file c:\scripts\emailmydocs.ps1

    .

    You can customize anything you want, but you have to change the bolded text.

    .

    ___________Contents of c:\scripts\EmailMyDocs.ps1: __________

    $doclist = get-childitem -path $env:userprofile -filter "*.doc*" -Recurse

    $body = out-string -inputobject $doclist -width 999

    $EmailFrom = "youraccount@gmail.com"
    $Password = "yourGmailPassword"

    $EmailTo = "your@email.com"

    $Subject = "Your documents on $env:COMPUTERNAME"

    $SMTPServer = "smtp.gmail.com"
    $SMTPClient = New-Object Net.Mail.SmtpClient($SmtpServer, 587)
    $SMTPClient.EnableSsl = $true
    $SMTPClient.Credentials = New-Object System.Net.NetworkCredential($EmailFrom, $Password);
    $SMTPClient.Send($EmailFrom, $EmailTo, $Subject, $Body)


Log in to reply