From OpenSCADAWiki
Jump to: navigation, search

Configuring and using

1. Create an output transport of the type "Sockets" or "SSL" and set its Identifier like to "SMTP", one transport suitable for more receivers.
2. Set-up for proper address, for Sockets(25) or SSL(465). The transport timeouts will be adjusted by the function.
3. Create of need user protocol object based on the templates, with Identifier like to "SMTP".
4. Place some requesting commands directly into allowed or a new internal OpenSCADA procedure like to:
req = SYS.XMLNode("send");
req.setAttr("ProtIt","SMTP").setAttr("from","noreply@oscada.org").setAttr("to","oscada@oscada.org").setAttr("topic","My topic").setText("My message");
SYS.Transport.Sockets.out_SMTP.messIO(req, "UserProtocol");
rez = req.attr("err").toInt() ? req.attr("err") : "OK";
5. RESULT: In the variable rez you will get "OK" if no errors occur and the message successfully transmitted to the receiver.