This application note demonstrates how to setup the server to enable the latest logs to be sent via email and trigg this from a task.
You need a computer with a running blocks server and a web browser to use this application note.
We have prepared a PIXILAB-blocks-root folder containing everything you need to run the examples. Download this ZIP file and unpack it
If you do not know how to do this, read the instructions in the general setup section. This zip archive is a bit different from the other application notes, it has a blocks server config file and the root folder. The Blocks config file is a sample file showing the format of the mail settings that need to be set in your own blocks config file to enable the email feature in Blocks.
Prerequisites:
The task should be running for a couple of seconds at the most. Is it gets stuck until a timeout is reached, it indicates there is an issue with the email settings and the email server cannot be reached.
The email look like this:
Remember to check the spam folder if the email cannot be found in the inbox.
This application uses a user script that finds the latest log, zips it into a temp folder using the zip application installed on the server and then emails this on the recipient with the email feature built in to blocks.
the script is stored at the default location /script/user/MailLog.ts