I would like a PowerShell script that recurses a directory tree and emails any file with a modification date past a specified date/time. The top level directory has encoded in the folder name the email address of the user in the form of "[email @ [login to view URL]]". The script should process each top level folder in the specified base directory that is in a format of "Mike Smith [1099][email address]". Underneath the top level folder is a set of subdirectories typically organized by year and then in each folder is a set of Excel or other document files. The script should select all files modified after the specified date and attach them to an email. The email address is derived from the top level folder name. The body text of the email message should come from a specified file supporting HTML formatting.
The PowerShell script command line arguments
□ -base - Path to root directory
□ -cutoff - Cutoff date for last modification date to send any documents newer in the format of ISO 8601 yyyy-MM-dd HH:mm:ss
□ -body - Path to text file that contains the body of the email message
□ -from - From email address
□ -subject - Text of email subject
The script should have a configuration variable for the SMTP server name, usssl, and SMTP port.
Hi, I've done similar jobs in the past, my only concern would be on the size of the attachments as some mail servers have a maximum size in order to save some space.
Other then that, I don't see any particular problem with your request.
It would be helpful to have an example or a screenshot to see a folder name and structure.
Feel free to contact me to chat about the project or to set up a call any time you want.