Chapter 6. Email and SMS

Table of Contents

6.1. Introduction
6.1.1. How it works
6.1.2. A note about SMS text messages
6.2. Configuring the Mail Server
6.3. Sending a Test Message
6.4. Defining the Email Message
6.5. Assigning a Trigger
6.6. Setting Trigger Conditions
6.7. Configured Actions
6.8. HTML Message Examples
6.8.1. An HTML Message with Embedded Data Points
6.8.2. An HTML Message with a Table Created in Code
6.9. How to Send SSL-encrypted Email

6.1. Introduction

The Cascade DataHub lets you send emails and SMS text messages, triggered by a DataHub event such as a point value change, or by a timer. The emails and messages can be in plain text or HTML format, and they can contain current values for any data point in the DataHub

With this feature of the DataHub you can:

    Send SMS text messages to cell phones when an alarm event is triggered or a critical value passes a threshold.

    Design end-of-day reports that are delivered to managers' email accounts each evening.

    Provide managers with regular email updates of current status.

    Emails can contain data from live data feeds, Excel spreadsheets, ODBC databases and other sources.

    Eliminate errors associated with manually writing reports.

    Have the DataHub collect vital report information, format it as an Excel spreadsheet, and then email the file to key people for review.

6.1.1. How it works

The DataHub mailer uses a public data domain mailing program called Blat. DataHub scripts tell Blat what messages to send and to whom, and they control when Blat sends them. The script BlatSupport.g contains all the setup instructions necessary to get Blat running. This script is not usually edited except possibly to modify the Blat installation.

Any other script can start up Blat by including this line:

require ("BlatSupport.g")

In addition to this line, a typical mailing script contains instructions to send an email in plain text, HTML format using ASP, or both. The example script, MailTest.g contains examples of both methods. You can run this script to test the mailer, and then use the examples that follow to send your own messages.

The sections in this chapter show you how to:

6.1.2. A note about SMS text messages

Sending SMS text messages from the DataHub is done by simply sending a small plain text email to the appropriate SMS gateway email address. Most cell phone service providers offer email and text messaging options on new subscriptions.

For example, if you subscribed with Bell Mobility in Canada, and your new cell phone number was (416) 123 4567, then the email address for this phone would be:

4161234567@bellmobility.ca

and the SMS text message address would be slightly different:

4161234567@txt.bellmobility.ca

Normally, SMS text messages are sent from one cell phone to another, which is all handled within the cell network itself. Using the SMS text message address, you can send a regular email and it will be converted by the SMS gateway (txt.bellmobility.ca in the example) into a text message and be delivered to your phone. There may be a short delay while the conversion from email to text message occurs, but the message usually arrives in less than a minute.

Check with your cell phone service provider for the SMS text message address for your cell phone number.