|
<< Click to Display Table of Contents >> Sending an email from SpecView |
![]() ![]()
|
It is possible to setup SpecView's Strategy Controller to send email(s) when a certain condition occurs, such as an alarm. There are 2 ways to do this:
1. Using SpecView's Run External Program command to run an email program that has a command-line interface to send the email, see below.
2. Using an ActiveX control, see below:
1. Using SpecView's Run External Program command to run an email program, such as Swithmail:
Swithmail:
First download Swithmail (from: https://sourceforge.net/projects/swithmail/) and read the associated help file(s).
This is free software, but please consider donating using the the link provided.
Read Setting up SwithMail (GUI) to send an Email from SpecView for a step by step procedure to set up SwithMail's GUI to send Emails from SpecView.
If sending from a personal Gmail account, ensure two-factor authentication and an App Password has been setup.
For more information, please read SMTP Server Requires Secure Connection Error.
Swithmail is easy to setup because it has a user friendly graphical interface:

First you will need the following information:
| 1. | The name of the mail server and the port number. |
| 2. | Whether it uses SSL or not. |
| 3. | The login details for it, i.e. username & password. |
Use the Test Settings button to check if the entered details are valid.
Swithmail also has a command-line interface which means it can be run by SpecView without additional user action.
To view the available command-line options use command shown below:

Running Swithmail from SpecView:
Put the text of the email to be sent into a file, called for example: message.txt
Then:
- Create a SpecView Text User Variable called, for example 'Subject'
- Create a button and use the Button/Strategy action: SpecView: Run External Program
- To run the command:
swithmail.exe message.txt -subject '%%SpecView.Subject%%' -to user@domain.com

Both swithmail.exe and message.txt need to be in the Project's subfolder (C:\SV3\<project>\)
Or alternatively include their full pathnames when referring to them in the command-line above. If there are spaces in the pathname then it will need enclosing in quotes.
Once Swithmail is working correctly from a button on the screen, then it is possible to use SpecView's Strategy Controller to send an email automatically, for example, when an alarm occurs.
2. Using an ActiveX control:
The ActiveX control AddEmail can be used which is available from www.traysoft.com.
Please contact SpecView's Technical Support for further help.