Teleservice communication (SMTP email)
13.1 TM_Mail (Send email) instruction
If the CPU is changed to STOP mode while TM_MAIL is active, then the communication
connection to the email server is terminated. The communication connection to the email
server is also lost if problems occur in CPU communication on the Industrial Ethernet bus. In
these cases, the send process is suspended and the email does not reach the recipient.
NOTICE
Modifying user programs
Deletion and replacement of program blocks, the calls to TM_MAIL, or calls to the instance
DBs of TM_MAIL can break the linking of program blocks. If you fail to maintain linked
program blocks, then the TPC/IP communication functions can enter an undefined state,
possibly resulting in property damage. After transferring a modified program block, you
would have to perform a CPU restart (warm) or cold start.
To avoid breaking the linking of program blocks, only change the parts of your user
program that directly affect the TM_MAIL calls in the following cases:
• The CPU in the STOP mode
• No email is sent (REQ and BUSY = 0)
Data consistency
The input parameter ADDR_MAIL_SERVER is read when the operation is started. A new
value does not take effect until the current operation is complete and a new TM_MAIL
operation is initiated.
In contrast, the parameters WATCH_DOG_TIME, TO_S, CC, FROM, SUBJECT, TEXT,
ATTACHMENT, USERNAME and PASSWORD are read during the execution of TM_MAIL
and may be changed only when the job is finished (BUSY = 0)
Dial-up connection: Configuring the TS adapter IE parameters
You must configure the Teleservice adapter IE parameters for outgoing calls to connect with
the dial-up server of your Internet Service Provider. If you set the call "on demand" attribute,
then the connection is established only when an e-mail will be sent. For an analog modem
connection, more time is required for the connection process (approx. a minute longer). You
must include the extra time, in the WATCH_DOG_TIME value.
Table 13- 3
Data types for the parameters
Parameter and type
REQ
ID
TO_S
CC
776
Data types
IN
Bool
IN
Int
IN
String
IN
String
Description
A low to high (positive edge) signal starts the operation.
Connection identifier: See the ID parameter of the
instructions TCON, TDISCON, TSEND and TRCV.
A number that is not used for any additional instances of this
instruction in the user program must be used.
Recipient addresses: STRING data with a maximum length
of 240 characters
CC copy to recipient addresses (optional): STRING data
with a maximum length of 240 characters
System Manual, 03/2014, A5E02486680-AG
S7-1200 Programmable controller