Sending Email via the SEND_EMAIL Block
Original instructions
Using SEND_EMAIL to Send Pre-configured Email Messages
Use the SEND_EMAIL block in your application to programmatically send any of three email messages you previously configured in Control Expert.
NOTE: To successfully send an Email message using the SEND_EMAIL block, synchronize the Email client service and PLC application—i.e., activate the Email client service whenever the PLC is in RUN mode.
FBD Representation
Input Parameters
The following table describes the input parameters:
Parameters
Data Type
Description
ADR
ARRAY [0...7] OF INT
The path to the destination device, in the format of rack.slot.channel.
Use the EFB ADDR to convert from the string format to the array of INT. For example, if the module is configured at rack 0, slot 4, channel 0, use: ADDR(‘0.4.0’).
HEAD_KEY
INT
The email header number previously configured in Control Expert. Only values of 1, 2, and 3 are valid).
SUBJ_STR
STRING
The dynamic part of the email subject that is appended to the static subject string.
BODY_STR
STRING
The body of the email.
NOTE: Use the $N (or $n) two-character tag to insert a line break in the email text.
Input / Output Parameters
The following table describes the GEST management parameter, which is the only input/output parameter:
Parameters
Data Type
Description
GEST
ARRAY [0...3] OF INT
The management parameter, consisting of 4 words.
The GEST management parameter presents the following structure:
Description
Word Order
MSB
LSB
System-managed data
1
Exchange number
Activity bit—the first bit of the first word. It indicates the execution status of the communication:
  • 1 = Email is being sent
  • 0 = Email complete
2
User-managed data
3
Timeout
4
Length: the size of the data buffer.
NOTE: The length parameter is an output parameter. This word is written by the system and equals the total length of the email (header + body). The maximum size of header + body is 1024 characters.