How To Send An Email Alert From CX-Supervisor

In CX-Supervisor 4.0 and later, sending emails can be achieved 2 ways.

Method 1: Sending on Alarm events (no code)

Each CX-Supervisor Alarm can be selected to automatically send an alert email automatically, when the alarm condition is raised and cleared.  This method requires no script code to be written and therefore very simple:

  1. In the Developer, make sure you configure your SMTP server in the Project menu, Runtime Settings->Email Settings:
    * Your SMTP server address (for example SMTP.gmail.com if using gmail smtp server)
    * The User for your email account name
    * The password for you email account. This is so the EmailText() script can log in to your email account to send the mail.
  2. When configuring your Alarms, tick the box to send an email and enter the destination email for this type of alarm:

Tip: For the target email address, a good idea is to create a generic email account or group specifically for notification, for example OPERATOR_USER or MANAGER_NOTIFY rather then specify a user account directly. Then as employees join or leave the group membership or email forwarding rules can be manged by your IT team, and therefore not require your CX-Supervisor project to be rebuilt each time.

 

Method 2: Sending from script code

For sending on any other condition you can write a small script as On Condition script, button script etc using the EmailText() script function:

bSuccess = EmailText(Recipient, Subject, BodyText, cc, bcc, Attachments)

Note there is also an EmailReport() script function, if you want to take a report template file, and generate and send a new report file in one action.

Tip: For a simple sample project to test sending of emails see article Sample For Sending Email From CX-Supervisor

See also

How To Send Emails From CX-Supervisor With Gmail


Link:
http://www.myomron.com/index.php?action=kb&print=45



Comments  

Translate: