TO_S:, CC:, and FROM: parameters
The parameters TO_S:, CC: and FROM: are strings, as shown in the following examples:
TO: <wenna@mydomain.com>, <ruby@mydomain.com>,
CC: <admin@mydomain.com>, <judy@mydomain.com>,
FROM: <admin@mydomain.com>
The following rules must be used when entering these character strings:
● The characters "TO:", "CC:" and "FROM:" must be entered, including the colon character.
● A space character and an opening angle bracket "<" must precede each address. For
example, there must be a space character between "TO:" and <email address>.
● A closing angle bracket ">" must be entered after each address.
● A comma character "," must be entered after each email address for the TO_S: and CC:
addresses. For example, the comma after the single email address is required in "TO:
<email address>,".
● Only one email address may be used for the FROM: entry, with no comma at the end.
Because of run-time mode and memory usage, a syntax check is not performed on the
TM_MAIL TO_S:, CC: and FROM: data. If the format rules above are not followed exactly.
The SMTP email server transaction will fail.
STATUS and SFC_STATUS parameters
The execution condition codes returned by TM_MAIL can be classified as follows:
● W#16#0000: Operation of TM_MAIL was completed successfully
● W#16#7xxx: Status of TM_MAIL operation
● W#16#8xxx: An error in an internal call to a communication device or the mail server
The following table shows the execution condition codes of TM_MAIL with the exception of
the error codes from internally called communication modules.
Note
Email server requirements
TM_MAIL can only communicate with an email server using SMTP via port 25. The assigned
port number cannot be changed.
Most IT departments and external email servers now block port 25 to prevent a PC infected
with a virus from becoming a rogue email generator.
You can connect to an internal mail server via SMTP and let the internal server manage the
current security enhancements that are required to relay email through the Internet to an
external mail server.
S7-1200 Programmable controller
System Manual, V4.2, 09/2016, A5E02486680-AK
TeleService communication (SMTP email)
14.1 TM_Mail (Send email) instruction
1305