Blat logo

Blat is a command-line email client. You can easily use Blat to send an email when a service crashes / terminates (and FireDaemon restarts it) or when your service is stopped via a FireDaemon Events tab.

Blat can be run as a Windows service using FireDaemon Pro. This allows you to start and run the application automatically when Windows boots and before login. FireDaemon Pro also allows you to start multiple instances of the application, monitoring them and automatically restarting those instances in the event they crash. FireDaemon Fusion can also be used to manage your Blat service, plus other Windows services via your web browser.

Blat Setup Under FireDaemon Pro

Please follow the steps below to set up an Blat as a Windows service with FireDaemon Pro

Step 1: Download and Install Blat

  1. Download from here. Make sure you get the latest windows64 zip release.
  2. Extract the zip someplace on your hard drive. For the purposes of this guide we will use: "C:\blat3222". The folder name will be different if you're using a different version.

Step 2: Set Up Blat as a FireDaemon Pro Service

Download and install FireDaemon Pro. Double click the FireDaemon Pro icon on your desktop, then click on the New (i.e. +) button in the toolbar (or type Ctrl + N) to create a new service. Set up your service however you need it but for the purposes of this guide we will use Windows calculator as an example:

FireDaemon Pro Example Service Program Tab

Next, click on the FireDaemon Pro Settings tab:

Now click on the Events tab. Append a new Termination Event. This is where we set up your service to stop send an email with Blat when the service crashes / terminates.

FireDaemon Pro Example termination event

The most important field on the tab is the Parameters. The Parameters define the email settings. The full parameter list should be as follows:

-to -subject "Service Restarted or Stopped" -body "My test service crashed and was restarted or was stopped" -server -f -u username -pw password

Replace everything in quotes below with your mail server info:

-to ""  Specifies who the email is to be delivered to.
-subject "Subject" Is the email subject line. Use quotes if there are spaces.
-body "Body" Is the body of the email. Again, use quotes. You can also use a text file. See the Blat document for more info.
-server "" Is your SMTP relay.
-f ""  Is who the email is from
-u "username"  Is the email username
-pw "password"  Is the email password

Note: -u and -pw parameters are usually not needed in most cases. Check with your mail mail host if they're required.

Lastly, click the Save and Close (ie. the tick) button on the toolbar. If the service's Startup Type is set to Automatic or Automatic (Delayed-Start), it will start immediately.

FireDaemon Pro Services list