The MT-151 module with firmware version 2.04.01 is now capable of sending e-mails. Implementation of this functionality in the module allows you to send text messages using an external SMTP server.
The server should allow sending unencrypted messages. The content of the message may contain any UTF-8 characters, including Polish diacritics, but also letters from the Arabic, Greek, Persian or Cyrillic alphabet. The content can be enriched with dynamic elements of a value depending on the module status, such as analog input measurements, binary input states, signal level, time stamp and others.
The first step is to provide access from the module to the SMTP server enabling communication without the need to use encryption and SSL / TLS protocols. For SIM cards working with the Internet, we recommend using the service offered on the SMTP2GO.com website (1000 e-mail messages per month for free).
If the module has already been configured to connect to APN (2G / 3G network), you can start adding SMTP server support – it is required to start the service (the parameter Use email (SMTP) should be set to YES) and enter the SMTP server address (SMTP server address) , its port (SMTP server port), authorization methods (SMTP authentication), as well as the user name (Username) and password (Password) necessary to access the SMTP server.
The next step is to add an event that triggers the sending of e-mail messages. For the test purposes, the best input is the one which state we can easily change, e.g. binary input.
The last element of the configuration is the definition of the rule sending the e-mail. It comes down to selecting the event configured in the previous step as parameter settings (Trigger event), indicating the type of message (Recipient type) as e-mail, indicating the recipient’s address (Recipient address) and the title and content of the message.
In the message body, you can use UTF-8 encoded characters and SNCS commands that allow you to place dynamic content and special characters (e.g., a newline character). More details on SNCS can be found in the documentation of MT-151 LED and MT-151 HMI devices.
The above example uses the text:
Dzień dobry,#CRNastąpiła zmiana stanu wejścia I1. Wejście jest teraz #TXT(IB272+1).#CR#DATE #TIME, which after changing state I1 sends different content, depending on the status of this input:
For changing the logic state I1 from “0” to “1”
For changing the logic state I1 from “1” to “0”
Based on the above example, you can build your e-mail notifications by expanding the functionality of existing systems or by offering additional functionality in new implementations. We also invite you to contact our technical support department.