Specifications

Chapter 5 - AsconMBCommLib
171
Some practical indications on how to simplify the FB use:
before to start a new e-mail sending procedure or in case of error, could be use-
ful to execute the FB one time with the ENABLE input at FALSE to be sure the
internal FB variables have been reset and ready to restart in the correct way
while an e-mail sending procedure is active, it is important to verify the CON-
FIRM and ERR_CODE output. It is possible to assume the e-mail has been
sent correctly only if the ERR_CODE output never changed from 0 (zero) dur-
ing the entire sending process and until the CONFIRM output become TRUE. It
happens sometimes the ERR_CODE will be generated at the same time the
CONFIRM becomes TRUE
SERVER_ADDR
The SMTP address can be specified as numeric IP address (e.g. 192.168.5.1) or
with the specific identification name (e.g. smtp.mail.yahoo.it); from the Server
name, using the DNS, the system will find out the server IP address.
USER_NAME and PASSWORD
The FB supports both the 2 authentication modes indicated as “AUTH LOGIN”
and “AUTH PLAIN”. Both are based on the string user name and password. The
FB deals with the server the supported method and, in case no one of the method
is supported, it will try to send anyway the message supposing the server does not
require the user authentication.
MAIL_FROM
Sender e-mail address. The string used to specify the e-mail address MUST
ACCOMPLISH to the standard e-mail format. Anyway, it is important to remember
that the FB is designed only to send e-mail and not to receive so this field is just
an information and does not have any functional implication.
RCPT_TO
With this field it is possible to define several receiver addresses separated
by the “,” or “;”. The character “space” it is not considered a separator and
CANNOT be use before or after a “,” or “;”.
ERR_CODE
The sequence to send a message can fail for a lot of reasons, when this happens,
the ERR_CODE output change value from 0 (zero) to a different number in
according with the following table:
Value Description
1 Error with the server address
2 CPU error during the socket connection creation
3 Socket configuration error
4 Server connection error
5 Server communication timeout error
6 Internal socket error
7 Username or password encryption error
8 Username or password exceed allowed length
9 Username and password exceed allowed length
10 Address formatting not valid
11 Sender e-mail address exceed allowed length
12 Receiver e-mail address exceed allowed length