This example demonstrates how to use the parameters -attachmentdir, -zip, and -filemask. The -attachmentdir parameter specifies a directory from which to retrieve files to attach. The -zip parameter instructs NetMailBot to compress all of the files into a single attachment, optionally with a specific name that you specify. The -filemask parameter instructs NetMailBot to only work with the files that match the given file mask.
NOTE: You should change the email addresses in the downloadable batch file to your own email address(es) before running a test.
Prepared Example Files
Check this paragraph: The -attachmentdir parameter in NetMailBot uses full paths. We have assumed a particular path as shown in the batch file contents below. Therefore, download this file to C:\tmp on your hard drive or edit the -attachmentdir parameter to reflect wherever you unzip the archive.
The archive contains four files:
Batch File Contents
This is the content of the batch file:
netmailbot.exe -to firstname.lastname@example.org -from email@example.com -server localhost -attachmentdir "c:\tmp" -zip -filemask "*.txt"
NOTE: If you do specify a custom filename for your attachment, e.g. -zip "myatt.zip", make sure not to forget to specify the .zip extension, that is, don't specify a name like -zip "myatt". If you do forget, some mail clients might receive the attachment as e.g. "myatt.dat", and will most likely prevent the recipient from being able to open the attachment for security reasons. ".zip" is likely to be a trusted file type, so your recipients should be able to open the attachment.