> For the complete documentation index, see [llms.txt](https://help.qtech.co.nz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.qtech.co.nz/datran/datran-vi-scada/datran-vi/alarms/email-alarms.md).

# Send alarms by email

Set up the DATRAN Paging Service to email alarms to operators through your SMTP mail server, test it, and change the email text.

DATRAN can be configured so that an email message is sent to a nominated operator when a predetermined condition is reached. Emails are sent using the DATRAN Paging Service.

{% hint style="info" %}
**Applies to:** DATRAN VI with the Paging Service and Alarm Service installed and running.
{% endhint %}

## 1. Set the mail server

1. In DATRAN Browser, double-click **\<computer>\Applications\Paging Service**.
2. Go to the **Email Options** tab.
3. **Server:** the network name of the mail server.
4. **From Address:** the email address that the emails will appear to come from. Note that this address doesn't necessarily have to exist.

{% hint style="warning" %}
Set the **From Address**. If you don't set this then all of the diagnostics will look like the email was successful but the email will not have been sent!
{% endhint %}

The POP3 fields can be ignored unless you want to have email alarm acknowledgments.

## 2. Set up the operator

In the operator's properties:

| Property | Set to                                                                 |
| -------- | ---------------------------------------------------------------------- |
| Pager ID | The email address of the operator, which must be a valid email address |
| Protocol | `SMTP`                                                                 |
| Retries  | A value > 0                                                            |

## 3. Send a test email

1. Insert a `_Pager_Message_` node into DATRAN and set the following properties:
   * **Subject**: the email subject
   * **Message**: the body of the email
   * **Operator**: the operator you have set up in the previous step
2. Apply it.

If all went well the email should arrive at the destination. DATRAN Diagnostics shows lines like `Connecting to SMTP Server`, `Sending message` and `Successfully sent message`.

## 4. Add email to an alarm class

1. In the alarm class, add an escalation and double-click it.
2. Select the **Alarm Pager Message** annunciator, and ensure **Enabled** is set to Enabled.
3. Select the operator that you have configured earlier.
4. Enter a new property called `Page` and set it to `1`. This is required to enable the paging.
5. Click the **Apply Annunciator** button at the bottom of the screen.

Trigger your alarm by setting the trigger node to 1 and see if you receive the email. If all is successful you will get a tick under **Applications\Paging Service\Paging Annunciators**. If however something went wrong you will get a cross and a reason, for example `Page must be specified`.

## Change the email text

By default it looks like:

`It's {(ALM)D/M/YY hh:mm} and {Description} is in alarm, dial xxx-xxxx. Alarm ID={Alarm Id}.`

The format of this message can be changed by altering the alarm annunciator at **Applications\Paging Service\Paging Annunciators\Alarm Pager Message\\*****Annunciator*****\Formats\ALM\Message**. The items in the curly braces { } are variables picked up from DATRAN from either: the Alarm itself, the Alarm Class or the Operator. The Description can be defined under the alarm node or in the alarm class itself. It is simply additional information that will be presented to the user in the email.

Existing generic annunciators should not have their formats altered. Many different alarm classes may use the same set of annunciators. To make a customised annunciator copy an existing annunciator that is close to what you want and rename it. See [Change the message text](https://help.qtech.co.nz/datran/datran-vi-scada/datran-vi/alarms.md#change-the-message-text).

## Email features

From V6.66, the Email Service provides connectivity with your Email server. It replaces the Email functionality of the Paging Service and offers the following additional features:

* Send Emails to Operator Groups
* Add Operators or Groups to the CC field of an Email
* Add Operators or Groups to the BCC field of an Email
* Specify and send Attachments
