Blat is a free tool that allows you to send emails from the command line or from a batch file. Of course, you can also use it with any scripting language that allows you to launch external commands. This can be useful, if you want to be informed when a script has failed or when it finished its job.

Blat doesn’t have to be installed, although it is possible to do so. However, this will only store a couple of settings to the Windows Registry such as the SMTP server or the number of times Blat will try to send an email. But you can also specify these settings in environment variables or as command options.

This is a simple example, which I just copied from the documentation of Blat:

@echo off
:::::::::::::: Lets set some variables ::::::::::::::
set eMail=tim@blat.tld
set subj=-s "Test Blat"
set server=-server localhost
set x=-x "X-Header-Test: Can Blat do it? Yes it Can!"
set debug=-debug -log blat.log -timestamp
::::::::::::::::: Now we run Blat! :::::::::::::::::
blat %0 -to %eMail% -f %eMail% %subj% %server% %debug% %x%

Leave a Comment | Subscribe RSS | Newsletter |