Sending automated emails from within Trading Blox

Sending emails from within Trading Blox is a powerful feature. Here is a simple example showing how to send an SSL HTML email that has both an attachment and embedded image in the email body. This can be useful when running the order generation process unattended either from a local or hosted server. And also when sending summary results to other members of the team.

In this case we are sending the PDF version of the summary report because it contains all the charts and graphs in one file. Very transportable. We are then embedding one of the summary charts into the email so the user can see it quickly. Note that many images can be embedded in different places, and the HTML in the email body can be quite complex, and even be a file.

Note that we are using version for this example, and this code is put into the new Post Process Utility script. This script is run after all reports and files are closed, so they can be safely attached to emails and copied or renamed as necessary.

Scripting code: