• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
TRIGGERcmd
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

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

Windows
2
3
2.0k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R
    Russ
    last edited by Russ Jul 1, 2017, 2:06 PM Jul 1, 2017, 2:02 PM

    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)

    Russell VanderMey

    1 Reply Last reply Reply Quote 0
    • J
      Jd pt
      last edited by Aug 21, 2020, 10:03 PM

      could you make a video to explain better?, sorry I'm a beginner

      R 1 Reply Last reply Aug 22, 2020, 3:29 PM Reply Quote 0
      • R
        Russ @Jd pt
        last edited by Aug 22, 2020, 3:29 PM

        @Jd-pt, I'll try to get to this soon. In the meantime, do you have any questions.

        If Gmail is blocking you from sending, you might need to turn on "Less secure apps" for this script to use Gmail's smtp server: https://support.google.com/accounts/answer/6010255?hl=en

        Russell VanderMey

        1 Reply Last reply Reply Quote 0
        • First post
          Last post