SendMail (FB)¶
FUNCTION_BLOCK SendMail EXTENDS CBM.ETrigTo
The „SendMail“ function block establishes a connection to the specified email server and sends all given information to the server. An optional attachment can be added. To change the buffer size for reading a file the parameter „iBufferSendAttachment“ can be changed by selecting the library in the library manager.
- InOut:
Scope
Name
Type
Comment
Inherited from
Input
xExecuteBOOLRising edge: Action startsFalling edge: Resets outputsIf a falling edge occurs before the function block has completed its action, the outputs operate in the usual manner and are only reset if either the action is completed or in the event of an error. In this case, the corresponding output values (xDone,xError) are present at the outputs for exactly one cycle.ETrigTo
udiTimeOutUDINTDefines the time (µs) after which an FB (e.g. requiring an external acknowledgement) aborts operation due to a timeout with error message.
ETrigTo
Output
xDoneBOOLTRUE: Action successfully completedETrigTo
xBusyBOOLTRUE: Function block activeETrigTo
xErrorBOOLTRUE: Error occurred, function block aborts actionFALSE: No errorETrigTo
Inout
ServerFBInput
userInfoLogin name and password for the SMPTP server. If no authorization is required set userInfo.sUserName to ‚‘.
mailToSendInformation about the mail to send.
mimeTypeMIME_TYPEType of the email, whether text or html
Output
eErrorLocal library error ID
sServerMessageSTRING(255)Detailed error message from the server