Importing Email Attachments with gsqlcmd

Importing Email Attachments with gsqlcmd

gsqlcmd includes the GetAttachments utility that allows saving email attachments into a local folder.

Then you can import data from the saved attachments using gsqlcmd.

gsqlcmd allows getting data from XML, JSON, CSV, HTML, Excel and plain text files.

Also, gsqlcmd automatically extracts files from the zip and gzip archives.

To get the GetAttachments short help, run:

GetAttachments.exe help

To configure the tool, run:

GetAttachments.exe init

The tool creates the default configuration file GetAttachments.cfg:


To run the tool, use the command:

GetAttachments.exe [<configuration file>]

Configuration File Format

GetAttachments.cfg is a CSV file with the following required fields:

Activetrue | false
ProtocolPOP3 | IMAP
ServerPOP3 or IMAP server
UseSSLtrue | false
Deletetrue | false
MaskA file mask to save attachments like \*.gz,\*.xls*
AttachmentFolderThe folder to save attachments
ArchiveFolderThe folder of the processed attachments

You can move the processed attachments from the AttachmentFolder to the ArchiveFolder folder.

The tool checks the ArchiveFolder folder to prevent saving processed files into the AttachmentFolder folder in the next cycles.