Sendmail with onchange


#1

@anonqaskigyf
Hi Christian,

I will follow up this post with an example script from Zach and a link to another example.

Deryck


#3

Hi Christian,

Here is an example Zach wrote for you.

Rem --- eWON start section: Cyclic Section
eWON_cyclic_section:
Rem --- eWON user (start)
Rem --- eWON user (end)
End
Rem --- eWON end section: Cyclic Section
Rem --- eWON start section: Init Section
eWON_init_section:
Rem --- eWON user (start)
ONALARM "TagTest","GOTO ProcessTagTestAlarm"
Rem --- eWON user (end)
End
Rem --- eWON end section: Init Section
Rem --- eWON start section: User Section
Rem --- eWON user (start)
ProcessTagTestAlarm:
    A% = ALSTAT("TagTest")
    PRINT Time$;" TagTest alarm ";A%
    IF (A%=2) THEN
        Rem Send eMail only when the alarm occurs
        N$ = CHR$(10)+CHR$(13) : Rem CRLF
        A$ = "This is my customised alarm eMail for tag TagTest" + N$
        A$ = A$ + "The current value of TagTest is " + STR$(TagTest@) + N$
        A$ = A$ + "The current time is " + TIME$
        SENDMAIL "support@hms.how ","","TagTest alarm Subject",A$
    ENDIF
END

Here is another example we have posted too. eWON Flexy Alarm Tag Values & Global E-mail Recipients