Link to home
Start Free TrialLog in
Avatar of K A
K AFlag for United States of America

asked on

How to automatically email the contents of a Windows folder?

How to automatically email the contents of a Windows folder?

We have an accounting application that can automatically generate report files, but it does not have the ability to automatically email them.  

Does anyone know of an SMTP command line, or free/inexpensive software that will allow us to take the contents of a given Windows folder and email them as attachments on an automatically scheduled basis?

More info:  We do NOT have the flexibility to purchase and install Microsoft Outlook for this purpose.  We CAN use Mozilla Thunderbird in conjunction with FireDaemon so that we have a MAPI-compliant email program running in the background... or, as mentioned above, perhaps we could use an SMTP command line using a Gmail SMTP server.
ASKER CERTIFIED SOLUTION
Avatar of NVIT
NVIT
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Agree. You can also run a PowerShell script watching the folder for new files, and mailing them as they come in.
What should happen with the files in that folder after they have been included in emails?
Avatar of K A

ASKER

Thank you NVIT for the fast response... You are correct - we've identified Send-MailMessage in Powershell that should work nicely for us.  Qlemo, thanks for following up.  In this particular case, as each file is generated, it will overwrite the previous one, so there is no risk of that folder filling up with old files.  HOWEVER, it occurs to us that we may wish, in other circumstances, to delete the oldest files.  Perhaps you have a script that shows how to do this?  (Don't spend any time on that though - it's not a need at the moment.)

Thanks!
If the old file is overwritten each time, I would only make sure to delete or rename the file after having mailed it. Otherwise, if using a scheduled task it might  see the same unchanged file and mail that.
If you can directly trigger the PS code after creating the file, you are good already.