In many SCADA applications, it's essential to alert operators immediately when an alarm is triggered.
atvise SCADA allows you to send automatic email notifications whenever a specific alarm condition occurs.
This example shows how to configure an SMTP server, attach a script to an alarm, and automatically send an email notification when the alarm is activated.
✅Steps
- Add SMTP Server
- Go to the SMTP configuration in atvise.
- Create a new SMTP server.
- For this example, we use smtp.gmail.com.
- If you're using Gmail, make sure to generate an App Password: How to Configure Gmail SMTP Server Settings - DEV Community

- Create a Modification Script:
- Create a script that handles the email notification.
- Copy and paste the example code (adjust recipients, subject, and message content as needed).
- This script will be triggered whenever the alarm condition changes to active.

// Alarm Object (alarm) var text = "Alarm Subject"; var node = alarm.InputNode; var status = alarm.ActiveState.en; var value = alarm.value; var desc = alarm.eventtext.en; //var time = new Date(alarm.activetime).toISOString().slice(0,19).replace('T', ' '); var timestamp = new Date(alarm.activetime); const options = { timeZone: 'America', hour12: false, hour: 'numeric', minute: 'numeric', second: 'numeric' }; const time = timestamp.toLocaleString('en-US', options) if (alarm.ActiveStateId == true) { var alarmtext = desc + " of "+nodeF[0]+" with status "+status+ " and activation value of " +value+ " at " +time; call("SYSTEM.LIBRARY.ATVISE.SERVERSCRIPTS.Mail.SendMail", { smtpserver: "test", // SMTP server configured previously from: "example@gmail.com", to:"example@gmail.com", subject: text, body: alarmtext })Attach the Script to the Alarm Condition:
- Go to your alarm configuration in atvise.
- Set the modification script to the specific alarm.
- When the alarm is triggered, the system will automatically execute the script and send the email.
Test the Configuration:
- Trigger the alarm condition manually or simulate it.
- Check the email inbox of the recipient.
- You should receive an alarm notification almost instantly.
Example Reference
You can also test this feature using the atvise Live Example available in atvise live under Scripting section.

Tip
For production environments, use a dedicated SMTP account and make sure your firewall allows outbound traffic on the required port (e.g., 465 or 587 for Gmail).
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article