torgesta.com

Automatically send email with blat

A very common question we get about MyTrigger is the question about sending emails from MyTrigger. To send email, MyTrigger needs the help of an external tool, and what we recommend is Blat. Blat is a free win32 command line program for sending email. It’s very small, very easy to use and in our experience very reliable. Here’s the blat installation instructions from their own readme:

1) Copy the file “Blat.exe” to your “WINNT/SYSTEM32 
directory, or to any other directory in your path.
2) Optionaly, run:
“Blat -install smtp.yoursite.tld youruserid@yoursite.tld”
As you can see, it’s extremely easy to get started with blat. After that, your good to go. To send an email from a command line script, all you do is run:
blat filetosend.txt -to someone@somewhere.com /
 -subject “testing blat”

We’re running an automatic build system. It’s running one of our servers and automatically builds the entire MyTrigger product on a schedule and manually whenever needed. The end result is that a new folder is created with a name like “//buildhost/builds/MyTrigger_1.5.102.0?.

Then we have another computer that is running smoke tests on new builds, we want to avoid installing any developer tools on the test machine since that would make the machine rather unrepresentative for what our users would normally run. The test computer is running a known stable version of MyTrigger that watches the /builds folder on the build machine. Whenever a new build is ready, MyTrigger detects that and can launch the smoke tests. For sanity, the stable version of MyTrigger is shut down during this test and turned back again afterwards, but that’s a condition that should be considered rare :-)

Once the smoke tests are done, the script sends an email using blat to notify that the build is done and the result of the smoke test.

Configuring MyTrigger to do this for us is actually pretty simple. Here’s how:

1) Create the script that should run when the trigger fires:

REM I’m using forward slash instead of backslash due to
REM a feature in Wordpress that I’ve left alone.
REM ************************************************
REM Start the smoke test, it’s logfile is in 
REM /tests/runtests.log
REM ************************************************
call \tests\runtests.cmd

REM **************************
REM Email the log
REM The -tf switch tells blat to look
REM in the specfied file for the recepients
REM ***************
blat \tests\runtests.log -tf recepients.txt /
     -subject “logfile for %date% %time%”

2) Configure MyTrigger to listen to the interesting folder. Bring up the MyTrigger UI, go to the Folders tab and press “Add". Type the path to the Folder to watch, note that it’s OK to watch UNC (network) folders as long as the underlying file system in NTFS. I check the “Watch subfolders” checkbox since what I’m waiting for is files to be added in a new subfolder. I’m using a *.txt wildcard filter since I know that in my specific case, the last thing that gets copied to the build folder is a buildlog.txt. I choose to only have MyTrigger react when a file or folder is added. At last I type the name of the batch script we just created and press save. There, the trigger is done!

As you can see, blat and MyTrigger helps creating a powerful, time saving solution that’s less prone to error that the manual alternative. Just the way we want it.

2007-05-17

Updated version of MyTrigger in the lab. After a far too long period of time without any news, we're glad to announce that MyTrigger 1.8 will be released shortly. The new release will most notably contain bug fixes, but threre are a couple of new features included as well. Please come back shortly for more information. .

2005-09-01

MyTrigger 1.7 is released. New features include support for Samba folder (folders on a remote Linux or Unix computer) and triggering by event id. . Read more about the new version on the product page.

2005-07-20

MyTrigger 1.6 is released. New features include running MyTrigger as a service, delaying folder triggers until the target file is unlocked, better support for Event log triggers, Stealth mode... Read more about the new version on the product page.

2005-06-27

torgesta.com support forum is online. The forum is intended to help users of torgesta.com products get help and help each other. Please visit today.

2005-02-14

MyTrigger 1.5 is released.

2005-01-21

Today we're making the beta of MyTrigger 1.5 publicly available. Your're welcome to download MyTrigger 1.5.111.0 right and try it out. Don't be shy with comments, we're wating for your feedback!

2005-01-18

Last week the first beta of MyTrigger 1.5 became available for our beta testers. The 1.5 versions bring a lot of new features to the table. Now MyTrigger can be used to monitor the file system, the event log, status of services and processes etc.

2004-12-03

MyTrigger 1.2 is soon ready for beta testing. We're looking for beta testers. If you’re interested in getting a peak at the next version really soon and see if MyTrigger 1.2 fits your needs, please drop us an email to betatest@torgesta.com for details. Those beta testers that provides real (and valuable) feedback will get one ore more free licenses for MyTrigger.

2004-11-24

A new MyTrigger usage sample have been added on the MyTrigger page. This one is about how to use MyTrigger to make using Hotsync and a USB bluetooth device a little easier.Go check it out!

2004-11-09

A MyTrigger usage sample have been added on the MyTrigger page. It describes how you can use program launcher MyTrigger as an automation tool to help your computer keep up to date with the latest Windows patches and Anti virus definitions. Go check it out!

2004-11-06

Automation tool MyTrigger 1.1 has received a 5 star rating over at TopShareware.com.

2004-11-01

MyTrigger 1.1 is released. Along with some bug fixes, this release include support for detecting changes in folders. With this new feature you can launch your custom scripts whenever a file or folder is changed in any way. Download your free trial today

2004-10-24

MyTrigger 1.0 is released. The build number of the 1.0 version is 1.0.49.0. If you have a previous build installed, you should upgrade.

2004-10-01

Program launcher and automation tool MyTrigger is released for beta testing. Do you want to participate as a beta tester? Navigate to the MyTrigger product page to read more.

2004-10-01

The web site is up and running.

 
 

copyright 2004