Configuring Electronic Mail Notification
 
Introduction
The electronic mail notification service allows controller-based projects to report alarms or events. The controller monitors the system, and can automatically create an electronic mail message alert with data, alarms, and/or events. Mail recipients can be either local or remote.
NOTE: Test the email block before using it in an application. If you improperly configure an email MSTR block to receive an email when a detected problem occurs, the email may not be sent as expected.
Mail System Types
The simple mail transfer protocol (SMTP) provides 2 mechanisms for transmitting email messages:
Mechanism
Condition
Result
direct connection
Sender and receiver are connected to the same transport service.
Email messages are sent to host.
relay system
Sender and receiver are not connected to the same transport service.
Email messages are relayed from one server to another server.
To relay messages, the SMTP server uses the addresses of the:
  • destination host
  • destination mailbox
Mail Service Client
The 140NOC78100 control head module includes an SMTP client. When the module receives a specific request from the project, it sends an email message to the mail server.
Displaying the SMTP Page
To display the SMTP page:
Step
Action
1
Click Services in the navigation tree in the left panel of the Device Editor.
Result: The Services page opens.
2
In the Services page, set the SMTP field to Enabled. Then click Apply.
Result: SMTP appears in the navigation tree.
3
Select SMTP in the navigation tree.
4
Click Apply to save changes and leave the window open, or click OK to save changes and close the window.
Configuring the Mail Service
A user-defined event or condition triggers the MSTR block to create a message. Each message uses one of 3 user-defined headers. Each message sent from the controller may contain text and variable information (with a maximum of 238 bytes).
The project selects the appropriate header. Each header contains:
The following properties can be viewed and edited in the SMTP page:
Property
Description
SMTP Server IP Address
Enter the IP address of the mail server.
SMTP Server Port
The default TCP port number for SMTP is 25. Configure the port as specified by your local mail server.
Password Authentication
If security is needed, enable Password Authentication by selecting the check box. Enter values for:
  • Login
    • Any printable character allowed
    • 64-character maximum
  • Password
    • Any printable character allowed
    • 64-character maximum
NOTE: You can use an optional login (system ID) and password to authenticate the connection to the SMTP mail server. The SMTP-supported authentication method is LOGIN.
Email Header
Each header contains:
  • Sender’s ID in the From field
    • 32-character maximum (no spaces)
  • List of recipients in the To field
    • Separate each email address with a comma.
    • 128-character maximum
  • Fixed part of message in the Subject field1
    • 32-character maximum
1 The Subject field consists of 2 parts:
  1. Fixed (32-character maximum)
  2. Dynamic (206-character maximum)
An authorized administrator can define and update the text and variable information. Define the 3 mail headers to indicate different levels of importance. For example:
  • Header 1 could be Detected problem reported by PLC 10.
  • Header 2 could be Notification from substation 10.
  • Header 3 could be Info message from water system.
Listing different recipients in each of the 3 headers allows the right information to flow quickly to the correct recipients. The project adds pertinent information such as the specific device, process, or location. This pertinent information is added to the body of the mail message. Then, the complete message is sent to an electronic mail server for distribution to recipients. These recipients could be engineers, managers, or process owners.
Using the MBP__MSTR Block for Mail Service
Each operation is designed by a code. To send an email message, use the MBP_MSTR block with function code 13.
MBP_MSTR Parameters
The following table describes the MBP_MSTR parameters:
Parameter
Data Type
Description
enable
none
on = enables selected MBP_MSTR operation
abort
none
on = terminates active MBP_MSTR operation
active
none
on = instruction is active
error
none
on = MBP_MSTR operation is terminated prior to completion
success
none
on = operation successful
control
INT, UINT
Control block is the first of several network-dependent, contiguous holding words and the first of 9 contiguous words entered in the top node.
The remaining 8 words are:
displayed: identifies one of the MBP_MSTR = 13
first implied
displays detected error status (See Mail Service Detected Error Codes.)
second implied
displays length (number of words transferred)
third implied
not used
fourth implied
high byte: slot address of the 140NOC78100 head module or 0xFE for the 140 CPU 651 •0
low byte: 0 (not used)
fifth implied
not used
sixth implied
not used
seventh implied
not used
eighth implied
not used
databuf
INT, UINT
The databuf parameter is the address of the buffer including the data inserted into the body of the email message. The data should be in ASCII format starting at the second word.
NOTE:
  1. The least significant byte of the first word contains a valid (configured) mail header (should be value 1, 2, or 3).
  2. The most significant byte of the first word contains the length of the dynamic part of the message’s subject field. The length is between 0 and 238 characters.
Databuf Parameter Description
The first word of the databuf parameter contains the following information:
Byte Number
Description
Value
1 (least significant byte)
mail header
{1, 2, 3}
2 (most significant byte)
Nb n of extra characters in the subject
user-defined (between 0 and 238)
The second and subsequent words (maximum 119) contain the data (ASCII format) that will be copied into the email message. The first n characters are added to the configured email subject. The remaining characters (2* N-2-n) are part of the message body. N represents the number of words transferred.
Electronic Mail Notification Service Subtree
The electronic mail delivery service subtree contains the following objects:
Service
Description
emailIndex (1)
index value in the email service table
smtpStatus (2)
global status of the SMTP service:
  • idle (1): no configuration
  • operational (2): operational and running
  • stopped (3): stopped
smtpSrvAddr (3)
IP address of the remote SMTP server
smtpMailSentCnt (4)
total number of emails sent to the network and successfully acknowledged by the server
smtpErrCnt (5)
total number of emails:
  • not sent to the network
  • sent but not successfully acknowledged by the server
The smtpLastErr (6) object details the detected errors.)
smtpLastErr (6)
last detected error code (See details in the Configuring a Commuinication Module with TFE {Private MIB topic.)
smtpLastMailElapsedTime (7)
number of seconds elapsed since last successful email sent
smtpLnkSrvStatus (8)
status of link between communication module and remote SMTP server:
  • NOK (1) = SMTP server cannot be reached.
  • OK (2) = SMTP server can be reached.
smtpSrvChkFailCnt (9)
number of times link to SMTP server has been detected as down
Operating Modes and Sending Requests
Because the controller program sends the email request, a controller cannot send an email message either while in the stopped mode or while downloading a project. As soon as the controller is in run mode, the function block sends a request during the first project scan.
Diagnostic counters are reset to 0 after either a power-up, a project download, or a reconfiguration of the mail service.