-
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) -
could you make a video to explain better?, sorry I'm a beginner
-
@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
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login