# Iterate over all files and only add the ones that have an. It has been automatically generated by a script." $mail.body = "This is the body of the email. $mail.subject = "This is the subject of the mail" Write-Host " : Full path for the folder which contains the files" Of course, you are free to remove this extension filtering for your own purposes.Īlso, note that Outlook must have a configured email account for the sending process to succeed. html) and that exist in a specific folder (passed as parameter to the PowerShell script). The script below is the result of a collection of snippets and bits of code I found in various places around the Internet that allowed me to solve this problem.įor this example, I only want to send the files which have a specific extension (. I decided to use a Windows Scheduled Task, that would wake up at that time and invoke a PowerShell script. The dialog IMAP Account Settings will open up. Click Advanced options and check the box for Let me set up my account manually. Enter an email address to add your account. A few days ago, I had to find a way to automatically send an email with attachments, at a predetermined time, using Outlook and PowerShell. The Outlook wizard for setting up a new account will open.
0 Comments
Leave a Reply. |