HomeVisionXL Plug-in for sending EmailsThe sendmail plug-in for HomeVisionXL allows the user to setup special trigger strings that will cause a selected file to be sent as an email message whenever the schedule running in the HomeVision controller transmits a special string on the serial interface.
After the plug-in has been installed and enabled, the SMTP server settings
and trigger strings need to be configured in the "Configure Email Triggers"
screen that can be opened by selecting "Configure Sendmail" from the Plugins
menu.
The SMTP Server and Port field should be filled with the data that your ISP has provided. You can also copy this information from your regular email client. The plug-in is able to perform authentication using the PLAIN and LOGIN authentication methods. Authentication will always be attempted if a username and password have been configured, even if the server does not specifically ask for it. Email triggers Multiple trigger strings can be defined and each can have its own contents, subject and distribution list. Only a single sender and SMTP server can be defined for all emails. That should be sufficient for normal use. New Email triggers can be added by clicking the Add button. Existing triggers can be modified by selecting the trigger to be edited and clicking the Modify button. Both actions will bring up the "Modify Email Trigger" screen shown on the right. Double-clicking on a trigger will also open the "Modify Email trigger" screen. Whenever the string entered in the Trigger field appears on the serial interface, the specified email will be sent. Trigger string matching is done insensitive of upper- and lowercase. To emphasize that, the trigger can only be specified in lowercase letters. Defining the email message The subject of the email can be specified in the Subject field. In the recipients field you can specify the email addresses the email will be sent to, one recipient per line. All recipients will appear in the To list of the email. No provision has been made to put recipients on the Cc or Bcc list.
The contents of the email is taken from a file specified in the File
field. To assist with specifying a file name, a file selection dialog can be
opened by clicking the ... button. If no file name is specified, the
body of the email will contain the text "#Empty". If there is a problem
opening the file at the moment the email is supposed to be sent, the error
message will be included in the email.
The fact that the email body is taken from a file combined with existing serial commands to the PC functionality allows you to include variable data in the email. Example: The following code in the Security Events action will send an email when an alarm occurs in partition 1 or partition 2 and tell you in which partition the alarm occured and at what time. If Security: EVENT: Partition 1 alarm occurs Or Security: EVENT: Partition 2 alarm occurs Then Serial port 1: Transmit string 'Clear text file "alarm.txt"' Serial port 1: Transmit string 'Write to file "alarm.txt" "' If Security: EVENT: Partition 1 alarm occurs Then Serial port 1: Transmit string 'Partition 1 alarm' End If If Security: EVENT: Partition 2 alarm occurs Then Serial port 1: Transmit string 'Partition 2 alarm' End If Serial port 1: Transmit Carriage return and Line feed Serial port 1: Transmit Time and Date Serial port 1: Transmit string '"' Serial port 1: Transmit string 'alarm email' End If Advanced tip: Due to the way Tcl works, it is also possible to put the result of a command in the mail instead of the contents of a file. If you define the filename starting with the pipe symbol "|", the rest of the string will be interpreted as a command to be executed. For example, specifying the file as "|ipconfig /all" will send an email with your current Windows IP configuration data. |