Commands and functions
P.
242 of 349
Resolve
Sendmail
Definition
●
Function
resolve
(
hostname
)
Arguments
●
1 argument
hostname
of data type c1400
Effect
●
The function determines the IP address of the given hostname.
●
If an error occurs, 0u32 is returned.
Data type result (Return)
●
Data type u32
(The return value goes asynchronous to the main development loop - see p. 124)
Example resolve
The hostname enertex.de shall be resolved.
Implementation in the user program:
hostname=$www.enertex.de$
IP=resolve(hostname)
Before the function
sendmail
can be used, the basic e-mail configuration has to be done (see page
137).
Definition
●
Function
sendmail
(
destination, subject, message
)
Arguments
●
3 arguments of data type c1400
Effect
●
A
message
with
subject
is sent to the
destination
(character string).
●
All character strings are restricted to a maximum length of 1400 characters.
●
A line break can be achieved by using the two characters '\n' in the string,
●
Return value: 0 = e-mail successfully sent
1 = in progress
2 = error
Data type result (Return)
●
Data type u08
(The return value goes asynchronous to the main development loop - see p. 124)
Example: sendmail
Every Monday at 08:00, an e-mail shall be sent to [email protected].
The subject is “EibPC“ and the message contains 2 lines “I'm still alive“ and “Here we go!”
Implementation in the user program:
[email protected]$
subject=$EibPC$
message=$I'm still alive\nHere we go$
if wtime(08,00,00,MONTAG) then sendmail(email, subject, message) endif
Note:
If you want to send html - formatted mails, use the
sendhtmlmail
Function (page 243)
HandbuchEibPC_USA-30.odt, 2017-05-11
Enertex
®
Bayern GmbH - Erlachstraße 13 - 91301 Forchheim - [email protected]