- April 2017
- January 2017
- December 2016
- November 2016
- October 2016
- August 2016
- December 2014
- June 2014
- May 2014
- March 2014
- February 2014
- December 2013
- November 2013
- September 2013
- August 2013
- June 2013
- May 2013
- January 2013
- December 2012
- October 2012
- April 2012
- September 2011
- August 2011
- June 2011
- December 2010
- August 2010
- July 2010
- October 2009
- September 2009
The topic that explains the use of Regular Expressions was very brief and just pointed to other useful resources on the net. Since questions regarding Regular Expressions are frequent this topic has been completed with more examples, a step-by-step tutorial that covers the basics and also how capture groups are used in the context of Email Parser.
I would like to also point here to a very interesting question that the user “logo11” has posted. If you are curious about how Regular Expressions are implemented in Email Parser it is worth a look.
Email Parser settings are stored per user. This means that all the items you see in the left panel and all the emails in the email history are linked to your Windows user account. If you open Email Parser from another Windows account in the same computer you will see everything empty, like you have just installed the program.
As most applications, configuration files are stored in a hidden folder called “Application Data”. As the path to this folder changes between Windows versions and configurations the best way to reach it is to simply type %APPDATA% in the file explorer, then hit enter:
Email Parser can send emails with the Send email automated process but the email editor you will find in this element is far from being friendly. It gives you just a plain HTML text box with no fancy buttons to insert images, set bold text etc. After all, Email Parser is not a traditional email client and is focused most on receiving emails and analysing them but how can you send nice emails easily with it? how to deal with that ugly HTML text box? The answer is simple: You can use another email client to compose your email, save it to a file and copy the HTML code back to Email Parser.
We will use the latest version of Microsoft Outlook to compose a sample email but any email cient will work. The idea is, once we get the email written, we have to save it to .eml or .html. Then open the resulting file with the Notepad and copy and paste the HTML code to Email Parser. The detailed step by step process is the following:
Email filtering allows you to select which emails are processed by Email Parser and which ones are ignored. It is also possible to use different email filters to drive different email types to different email parsers (think of emails with different formatting or contents, for example).
But what happen with emails not matching any criteria? You may want, for instance, delete them from your inbox. They take disk space and if you use the email address only to process emails they are not very useful. It is better to keep only those emails that are meant to be processed for reference (you also have the email history window in this case).
To implement this in Email Parser you have to use a feature called filter combination. Let’s see an example:
John receives at email@example.com two kinds of emails. He differentiates each type by the subject. They have the text [A] or [B] in the subject depending the type of the email. Accordingly, he has set up the following filters:
Each one only has one rule:
This new release mostly contains bug fixes and gives us back the Windows Service feature to parse emails completely in the background. It also have some performance improvements:
- Much faster email processing when database has many emails
- Fixed email parser testing full parser. The testing shown empty results on some installs.
- Fixed the double click in an email parser field list. Edit window now appears.
- Email filter table now has more space between items. Better readability.
- The email parser list that shows all the fields available now enables the remove button again when a field is selected
- The email editor button “Save email as .eml file” works again
- Fixed the email history list item text colour when an item is selected. Better readability.
- Fixed some email wrongly typed words here and there.
- Slightly bigger email viewer and now centred in the email history screen.
- Added a “…” button in the email history to show the useful but unknown context menu
- Windows Service is back to work again
- When that max amount of emails are reached in the email history oldest emails are removed and database file is compacted
We entered the regular expression:
Take anything that starts with '<' and ends with a '>'
Email parser is commonly used to parse the text contained in the email body or subject but it can also parse the contents of an attached PDF, TXT or DOC file. This feature is disabled by default, you need to activate it in a checkbox in the email source settings window called “Append attachment content to Body (plain text) field”. See the screenshot below:
Beware that you need to scroll to the end of the window to see it! Yes, it is a bit hdden.
Once activated, when a new email arrives Email Parser will manage to include the attachments contents in the email body. It is like if you opened the attached file, select all its contents and then paste them in the last line of an email you are about to send.
As you will notice, text formatting, tables, paragraphs tabulation etc are lost in the process. The plain text version of an email body cannot handle these features but it is enough in most cases for the parsing purposes. In the end, all you need is text to capture and do some operations with it.
Let’s se a sample email with an attached PDF and the results of activating this switch:
For some diffucult parsing tasks there is a method called “Multiple step parsing”. A new documentation page has been written to cover this topic.
Only useful for hardcore users! (or those dealing with really difficult emails to parse)
This new version comes with the following changes:
- Compatible with high DPI displays. If you have a screen with a pixel density greater than 96dpi (mostly newer laptops and high end screens) you will no longer see the program scaled and blurry.
- Some user have reported that the program was using too much memory after many days of very frequent automatic email processing and under high load conditions. This was due to some memory leaks of the program right panel. They have been fixed.
- Updated internal database technology for faster email processing.
- Fixed a problem that caused that the scripts were not running correctly under the run conditions “Run before any email is processed” and “Run after any email is processed”
- Fixed minor bugs displaying run conditions under the Automated Process edit window
- Fixed the links that pointed to the new redesigned web site from inside the program.
- As usual, many other minor issues have been corrected.
The following example shows how to save an email attachment in a MySQL database table. Loading file data differs from one database to another, they all use different SQL syntax and there are several methods for the same database.
In this case we will save the attachment files as a BLOB type and load it with a simple INSERT command.
The idea is first to retrieve the email attachments from the email being processed and then for each one (as it can be more than none) run a SQL sentence using the field value stored in <%Attachment%> that contains the path to the attachment file.
The following screenshot shows an overall view of the steps that need to be done. It is just the program left panel: