Email Settings for Alarm Worksheet

IWS has the ability to send emails automatically when alarm events occur. The emails are sent using the standard SMTP (Simple Message Transfer Protocol). Therefore, you just need a valid email account with a SMTP Server and POP3 server — it is not necessary to install any additional software, such as Microsoft Outlook.

Important: Before being email to send emails, it is necessary to execute successfully the CnfEmail function (from the built-in language) at least once. This function sets the email account parameters used when sending emails from the project (e.g., SMTP server, user name, password, and so forth).
Figure 1. Alarms Worksheet — Email Settings
Web Studio Help worksheet tasks alarm emailsettings Email Settings for Alarm Worksheet

Field Remarks Syntax
Enable send automatic email Name of the tag associated with the alarm. Checkbox
To, Cc, Bcc Target addresses to whom the emails will be sent. You can configure multiple email addresses in each box (To, Cc and/or Bcc) by separating the addresses with the semi-colon character ( ; ). Text and/or {Tag} (up to 1024 chars)
Subject When selecting “Use alarm message”, the alarm message itself is used as the subject of the email to be sent. When selecting “Custom”, you can configure a custom text to be used as Subject when sending the alarm. Radio-button / Text (up to 1024 chars)
Send 1 message per email When checking this option, each alarm is sent in an individual email and all emails are sent when the Send Trigger is triggered. Otherwise, all alarm messages are buffered and sent in only one email when the Send Trigger is triggered. You cannot disable (uncheck) this option when the Subject option is configured with “Use alarm message”. Checkbox
Remove failed messages from the buffer When checking this option, the emails are removed from the buffer after attempting to send them, even if there was an error (failure) and the email was not sent. Otherwise, the messages are kept in the buffer until they are sent successfully or when the buffer reaches its maximum size. checkbox
Send email when alarm is Allow you to configure which alarm events should generate emails:
  • Active: When the alarm becomes active.
  • Ack: When the alarm is acknowledged.
  • Norm: When the alarm is normalized.

Notice that each event can be enabled/disabled individually.

checkbox
Current Status The tag configured in this field, if any, is updated with the current status of the current or last email that the project attempted to send:
  • -2: Incorrect version of the INDMail.DLL library.
  • -1: The INDMail.DLL library is corrupted.
  •  0: SendEmailExt function is not being executed.
  •  1: Sending email(s)
  •  2: Last email was sent successfully.
  •  3: There was an error sending the last email.
Tag
Current Error The tag configured in this field, if any, is updated with the error message describing the result of the last email that the project attempted to send. Therefore, when configuring a tag in this field, this tag must be a String type. Tag
Message Format This interface allows you to configure the actual format of the message sent by email, based on the alarm event(s):
  • Day, Month, Year, Hour, Minute, Second, MS: The options checked will compose the timestamp for the alarm messages. MS stands for milliseconds.
  • Items: The options checked will compose the email message for each alarm. You can configure the order of the items, by using the Move Up and Move Down buttons.
  • Separator: Allow you to choose the separator used between the items checked in this interface.

While you configure these settings, the Sample field displays an example of the format of the message according to the settings being configured.

Checkbox and Radio-button
Send Trigger When the alarm events are generated, they are kept in an internal buffer (memory). When the tag configured in this field changes of value, the email(s) on the internal buffer are sent to the addresses configured in the To, Cc and Bcc fields. After being successfully sent, the emails are removed from the internal buffer. Tag
Max buffer size Maximum number of alarm messages (events) that can be stored in the internal buffer simultaneously. When this limit is reached, the buffer follows a FIFO (First-In, First-Out) behavior, discharging the older messages as soon as the newer messages are generated, guaranteeing that the buffer does not exceed the limit configured in this field. Tag or Number
Buffer size The tag configured in this field, if any, is updated with the number of messages (events) currently stored in the internal buffer. Tag
Clear Buffer When the tag configured in this field changes of value, all messages (events) currently stored in the buffer are deleted. These messages will never be sent. Tag
Disable send When the value of the tag configured in this field is TRUE, the Email feature is temporarily disabled. Alarm events generated while the Email feature is disabled will not be stored in the internal buffer. Also, emails will NOT be sent in this condition, even if the tag configured in the field Send Trigger changes of value. Tag

Email Settings for Alarm Worksheet