MailRules can be used to initiate applications. Combining this with MailRules' ability to transmit and perform actions at remote locations, means that with MailRules you have a quick and easy way of unifying disparate systems. In this topic, we will see how to enable a database export, transfer data and update a remote system, and how to maintain a history of transmitting data.
Although we aim to clearly illustrate the three points above, this demonstration is very tightly-coupled and we have to complete all three steps before completed process can be executed.
In this demonstration, we use the Northwind database that is provided as a sample with Microsoft Access. While we have enhanced the Northwind database to include import & export macros, it is very common for other mainstream products to have these facilities built into them, we chose to use the Northwind database because of its pandemic nature.
We start by creating an Outbound Rule by clicking the Add button on the Outbound Rule menu. MailRules shows us a blank Outbound Rule, the first thing we do is change the Rule Name to be more meaningful. The Rule Type defaults to Standard, but in this demonstration we want the recipient MailRules to take action with our data, so we change the Rule Type to be Advanced.

Next, we enter the recipients e-mail addresses into To:, since we are transmitting an Advanced Outbound Rule the Subject field is used by MailRules and we can ignore the message body.

Next, we select the file that we want to transfer from the What tab. We could click Add File.. and browse to the file that we wish to transmit, however, in this scenario, our file is only created by the export process we will run on our Access database, so the file to be transmitted does not yet exist. Therefore, in the entry box above the file listing, we type in the full path to the file and press ENTER. MailRules warns us that the file does not currently exist, we should double-check that we have typed the file and path properly, then click Yes to continue.
We don't need this file for anything after we've e-mailed it, so we also click Delete Files Once Sent.

Next, under When we specify this transfer should be performed - we'll say once at day at 12:00. So, we click Add, select EveryDay, enter the time, 12:00, and click OK.

Now, we need to generate our file by calling our local Access database and running a macro. This is done on the How tab. We need to do this before sending the e-mail, so we tick Run Application Before Sending. Now we can use the browse button to find our Access database and follow the database with the parameter, "run=export" to run the export macro. We also set MailRules to monitor this application until it is no longer running (our export macro will shut Access when complete) at which point we know we are safe to proceed with the generation of the e-mail. To tell MailRues to monitor the application, we set the command time to zero.

Clicking OK returns us to the Outbound Rule where we select Copy files to DONE folder, Zip Copied files and Build Archive. This combination of options will ensure that a complete history of all the data transmitted by this Rule is available for review should the need ever occur. We also select Processed Receipt Requested, which will give us confirmation that our actions are successful at the destination (this confirmation is transmitted to us by e-mail and MailRules can store this information for reporting).
We have completed everything needed to transmit the data - in the next step (which is still part of the Outbound Rule Add function) we will show how easy it is to get that data into the remote database.
Because we're using an Advanced Outbound Rule, we are able to instruct the recipient MailRules what actions to perform with the data that we transmit. On the Where tab, we specify where the transmitted is to be stored and what actions should be performed upon it.
In Folder/Alias we enter the full path where the transmitted files should be saved, we also supply the Default Password for recipients of this Outbound Rule. We will import the data into Access, so we need to Run Application, we specify the path to Access, the database and the macro to run.

As can be seen in the graphic above, Additionally, we want to have the resuls of our import returned to us, so we need to Run Outbound Rule, provide the name of an Outbound Rule at the destination and specify that the To: recipients should be overridden and that the e-mail should be directly returned to us (Reply to Sender).
Obviously this rule must already exist on the destination MailRules.
You will recall that we selected Copy files to DONE folder, Zip Copied files and Build Archive from the How tab of the Outbound Rule. These three functions combine to build a historical record of all data files transmitted by the Rule. The files are stored in a subfolder of your Working Folder called Done. To view the contents of the Done folder, from the MailRules main menu, select Tools, then Open Done Folder.
In this topic you've seen: