All posts by gearmage

Email actions: unzip, convert or decrypt PDF and run a script

Setup email actions such as unzipping an email attachment, converting the email attachment to pdf and running a script easily with Mail Attachment Downloader PRO Server.

This post will show you how to setup a rule to Unzip a file, then convert the unzipped .docx or decrypt a .pdf and then run a script.

In the Actions section, do the following:

  1. Select ‘After saving attachment‘ from the tree view on the left. Note that even though this says ‘After saving attachment‘, you can run actions on the body of the email as well which will be downloaded as an attachment when you click on the ‘Save email text’ checkbox.
  2. Click on Add button -> After saving attachment -> Unzip files and select any options as shown below. You can enter which specific files you want to unzip in the box which can also include wildcards or regular expressions. If you have multiple, separate each file or wildcard by a new line.automate email actions: unzip_files
  3. Select Unzip files from the tree view on the left. This is necessary to create a sub action under unzip files so every unzipped file runs the remaining action. You can also specify which files to unzip in the previous step. Now click on Add -> After saving attachment ->  Document conversion. Fill in the conversion details by clicking on the Add Conversion button. Note: You can also choose to decrypt the unzipped file if the source file was a PDF by providing the password to decrypt the file.automate email actions: madpro3_convert
  4. Select Document conversion from the tree view on the left. Then Add -> After saving attachment -> Run command line. Enter details to run a command line. In this case we are running a .bat file with the filename of the converted file – {FILENAMEEXT} in the screenshot below now represents the converted filename now from the previous step and not the original saved filename. automate email actions: madpro3_pda_runbat

That’s it.

If you have questions or need additional actions, please contact us and we can help assess feasibility.

 

PDF to DOCX conversion and more

Convert PDF to DOCX easily with Mail Attachment Downloader PRO Server

When you run the server version you can run the program as a Windows Service that runs 24×7 unattended. Then just email the PDF as an attachment to your email and have Mail Attachment Downloader PRO Server pick it up and automatically download/convert the file and save it in the way you want it.

  1. Open Global filters tab and either click the Add new filter or Edit selected filter button
  2. If you are creating a new rule, just enter a meaningful filter name.
  3. Under Actions, click Add action and choose  Document conversion. This will add a new action in the list to the left. Click on the Document conversion list item under After saving file. You will see the conversions that are configured on the right side. convert to pdf
  4. Click on the Add conversion button.
  5. In the From Type select Any doc and the To Type specify docx. Click OK.PDF to DOCX
  6. Save the rule and that’s it!

Any email that you receive that has a PDF attachment (including some other related formats like LaTeX etc.) will be converted to DOCX.

If you receive encrypted PDF files, you can provide the decryption password in the PDF Decryption Password text box as can be seen in the screenshot in Step-5. You will need to do this before you can convert it to DOCX.

With the Mail Attachment Downloader PRO Server version, you can use it to convert emails (.eml or .msg or .txt or .html) and email attachments (text, html, word, excel, powerpoint and more) to over 50+ formats (bmp, csv, dif, doc, docm, docx, dot, dotm, dotx, emf, epub, excel, flatopc, flatopcmacroenabled, flatopctemplate, flatopctemplatemacroenabled, html, htmlfixed, jpeg, mhtml, mobixml, odp, ods, odt, openxps, ott, pdf, pdfnotes, png, potm, potx, pps, ppsm, ppsx, ppt, pptm, pptx, ps, rtf, spreadsheetml, svg, swf, tabdelimited, tex, text, tiff, tiffnotes, wordml, xamlfixed, xamlflow, xamlflowpack, xlam, xlsb, xlsm, xlsx, xltm, xltx, xml, xps)!

You can use this to convert from the following popular formats:

  • DOCX to PDF, PNG, JPEG, HTML and more
  • PDF to DOCX, PNG, JPEG, HTML and more
  • CSV, XLSX to PDF, PNG, JPEG, HTML and more
  • PPTX to PDF, PNG, JPEG, HTML and more
  • EML to PDF, DOCX, PNG, JPEG, HTML and more
  • JPEG, BMP, TIFF, images to PDF, DOCX, HTML and more

If you have any questions or suggestions, please contact support.

Convert emails to PDF or TIFF including email attachments

Save emails as PDF or TIFF

It is really easy to save emails to PDF or convert email attachments to PDF with the Mail Attachment Downloader PRO and Mail Attachment Downloader PRO Server.

Converting document attachments to PDF or TIFF

  1. Create a new filter or edit an existing one in the Global Rule tab
  2. Under Actions, click Add action and choose  Document conversion. This will add a new action in the list to the left. Click on the Document conversion list item under After saving file. You will see the conversions that are configured on the right side. convert to pdf
  3. Add a new document conversion by clicking the ‘Add conversion‘ button.
  4. Pick the source format (From Type) and the destination format (To Type).  If you are using the PRO Server, then you can pick any format in the To. Otherwise, you will be limited to just PDF.
    convert to pdf
  5. Click OK

That’s it!

Now each document attachment (doc, docx, txt, html, rtf, eml etc.)  will be converted to PDF or TIFF or any To Type you selected above.

If you want to also save the email body in addition to the attachments as PDF or TIFF, check the Save as .eml checkbox in the rule and the document conversion action (from Doc -> PDF or TIFF) will also convert the .eml file to PDF or TIFF. The .eml extension is considered a document for conversion purposes.

If you want to convert other types such as cells (xlsx etc.), slides (ppt etc.) or images (jpgs etc), you can repeat Step-3 to add the different From’s if you would like.

This will save each attachment as a separate PDF or TIFF files. Further below we show how you can save emails and attachments as a single PDF. You can also save emails and attachments to a multi-page TIFF if required by following the same instructions except select tiff as the To type.

You may also choose to encrypt the PDF file by checking the ‘Encrypt PDF‘ checkbox if needed.

Save emails and attachments to a single PDF

To save emails and attachments as a single PDF, you will need the PRO Server version and the following setup:

  • Make sure Save as .eml is checked, this will save the email body.save as email
  • Ensure Document Conversion action is added and includes conversions from various types to PDF as shown below. Check the delete source files after conversion checkbox.Convert to PDF
  • The above will save the body and attachments all separately as PDF files. You can skip the next step if that’s all you want to do (save as separate files).
  • To merge them into a single PDF: Right click on Document Conversion and then add Merge PDF files action. Check the delete all source PDFs checkbox.

    Merge PDFs
    Merge PDFs

Now emails along with attachments will end up being a single PDF where the email is the first few pages and subsequent pages are the attachments rendered as PDFs.

Over 50+ Formats

If you get the Mail Attachment Downloader PRO Server version, you can use it to convert emails (.eml or .msg or .txt or .html) and email attachments (text, html, word, excel, powerpoint and more) to over 50+ formats (bmp, csv, dif, doc, docm, docx, dot, dotm, dotx, emf, epub, excel, flatopc, flatopcmacroenabled, flatopctemplate, flatopctemplatemacroenabled, html, htmlfixed, jpeg, mhtml, mobixml, odp, ods, odt, openxps, ott, pdf, pdfnotes, png, potm, potx, pps, ppsm, ppsx, ppt, pptm, pptx, ps, rtf, spreadsheetml, svg, swf, tabdelimited, tex, text, tiff, tiffnotes, wordml, xamlfixed, xamlflow, xamlflowpack, xlam, xlsb, xlsm, xlsx, xltm, xltx, xml, xps)!

You can use this to convert from the following popular formats:

  • DOCX to PDF, multi-page TIFF, PNG, JPEG, HTML and more
  • PDF to DOCX, multi-page TIFF, PNG, JPEG, HTML and more
  • CSV, XLSX to PDF, multi-page TIFF, PNG, JPEG, HTML and more
  • PPTX to PDF, multi-page TIFF, PNG, JPEG, HTML and more
  • EML to PDF, multi-page TIFF,  DOCX, PNG, JPEG, HTML and more
  • JPEG, BMP, TIFF, images to PDF, DOCX, HTML and more

Further reading

Some interesting how-to links and posts for further exploration:

Contact us

Contact us if you have any questions, suggestions about the functionality described in this article.

Save emails and attachments to a database

Save emails and attachments to a database (SQL Server)

In this post, we will explore saving emails and attachments to a database server like SQL Server by setting up an ODBC data source and using a post download Action to save contents of the email and/or attachments to a database.

The program supports and works with any compatible ODBC data source such as MySQL, Oracle, PostgreSQL and more. This post only explores setting up to save the data in SQL Server but also has information on how to tweak it for other database types.

This feature is available  with the Mail Attachment Downloader PRO Server version.

  1. Let’s start off by adding a new data source —  click on the Database tab -> Add ODBC source buttonDatabase Source
  2. Provide a name for the source first.Then pick either the 32-bit ODBC driver or 62-bit ODBC driver (depending on whether you installed the 32-bit or 64-bit version of Mail Attachment Downloader PRO Client or PRO Server).

    In our case, the driver “SQL Server” from the drop down indicates the 32-bit driver.  Then enter the Connection string that specifies how to connect to the server:

    Server=<computer name>\<SQL Server name>;Database=<DB name>;Trusted_Connection=yes;

    The above connection string is specific to SQL Server that is using a trusted connection. To connect in any other way to SQL Server OR to another database like Oracle, you can find ODBC connection strings here (make sure you select ODBC connection string and not any other on the site).

    An example of these filled in is shown below:
    Server=TESTPC\GEARMAGE;Database=TestDB;Trusted_Connection=yes;
    DBDetails2

  3. Click “Test Connection” button to make sure this succeeds. Then click OK.
  4. At this point a data source has been setup.
  5. Then create a new rule or edit an existing rule from the “Global filters” tab.
  6. Under Actions after save click Add action and then choose Save to database. This will add an action under After saving file in the list to the left.
    NOTE: The screenshot below shows other actions as well, if you have other actions you can chain the save to database action after those actions have taken place as shown below.
    Save to DB
  7. Pick the Source as the one you provided in Step-2.
  8. Specify a new table name (or an existing one) and then click “Create Table” if this is a new table and follow the prompts.  At this point a new table schema would be created and the SQL would be automatically filled in based on the questions you answered.
  9. Click “Test SQL” to test connectivity and table row creation, this will add a new row to the table to make sure everything is setup correctly.
  10. Click the Save button to save the new rule with the Save to DB action.
  11. Now you can click the Connect And Download button to test out the ability to save to DB.

You have setup the program to automatically save emails and attachments to a database.

IMPORTANT CONSIDERATIONS

  1. Make sure you select either the 32-bit ODBC driver or the 64-bit ODBC driver in the dropdown depending on which installation of Mail Attachment Downloader PRO Client or PRO Server you installed (license email has links to both versions of the install). This is supported in all Windows versions including Windows 10. In some cases default installations may only install the 64-bit driver and you may need to manually download and install the 32-bit ODBC driver for your database. Please consult the database documentation and Google on how to do this.
  2. Your specific connection string can vary depending on the type of database (for example, Oracle has different connection strings than MySQL). A useful site to help you with the ODBC connection string is https://www.connectionstrings.comMake sure you only choose the ODBC connection string in the site  for your database type (like Oracle). You may need to play around with the different strings and test connections to find the one that works. If your connection string includes a Driver name, make sure it matches exactly (space for space) the one you have picked in the dropdown.

Further reading

Some interesting how-to links and posts for further exploration:

Contact us

Contact us if you have any questions, suggestions about the functionality described in this article.

v3.1 PRO packs many new features

Extract emails and attachments, save to database, save email as PDF and more

We have introduced many new compelling features with the Mail Attachment Downloader PRO v3.1 release. Here is a quick overview of those features. We will have more detailed information about how to use these features in upcoming blog posts so stay tuned.

Before we begin, a quick note about the key differences between PRO Server and PRO licenses:

  • Our PRO Server versions let you perform automated tasks 24×7 on an unlimited number of email accounts and can run on Windows Server (and Windows Client).
  • Our PRO and PRO Limited versions cannot run on Windows Server and requires a user to be logged in when processing email attachments.

With v3.1 we have started to introduce more powerful email automation and processing features. Some of these are detailed below:

  • Convert email attachments after download to PDF
  • Encrypt or decrypt PDF email attachments automatically
  • Automatically print email attachments
  • Upload email attachments to Sharepoint online or on-prem

If you get the PRO Server, you get some even more powerful features and support for unlimited email accounts.

  • Automatically unzip email attachments and run rules (for example, unzip PDF file, then decrypt PDF and print it automatically!)
  • Automatically save email headers and optionally attachments to a database (which fields you save and how you want it saved are completely customizable).
  • Convert email attachments (text, html, word, excel, powerpoint and more) to over 50+ formats (bmp, csv, dif, doc, docm, docx, dot, dotm, dotx, emf, epub, excel, flatopc, flatopcmacroenabled, flatopctemplate, flatopctemplatemacroenabled, html, htmlfixed, jpeg, mhtml, mobixml, odp, ods, odt, openxps, ott, pdf, pdfnotes, png, potm, potx, pps, ppsm, ppsx, ppt, pptm, pptx, ps, rtf, spreadsheetml, svg, swf, tabdelimited, tex, text, tiff, tiffnotes, wordml, xamlfixed, xamlflow, xamlflowpack, xlam, xlsb, xlsm, xlsx, xltm, xltx, xml, xps)

For a full feature breakdown by PRO license type go here.

Have questions about these features or found an issue? Contact us at support@gearmage.com (this is the fastest way to receive support).

As always, we enjoy hearing your feature requests, send them to features@gearmage.com.