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.

Latest posts by Michael Pietroforte (see all)

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.

Subscribe to 4sysops newsletter!

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%

4 Comments
  1. CypherBit 14 years ago

    Great tool indeed, I just wish the current environment I work in would allow SMTP servers.

  2. wboy 14 years ago

    Be sure to also check out BMail (Freeware).
    http://beyondlogic.org/consulting/cmdlinemail/cmdlinemail.htm

    While I have never personally had the need, bmail also comes with mpack that allows you to package mime attachments for bmail sending... all possible from a command-line/batch script

    Some other potentially handy apps can be found site.

  3. Cypherbit, no SMTP servers around? You are working for the NSA or what? 😉

    Wboy, BMail looks great too. Thanks! I think Blat supports attachments too.

  4. stoffell 14 years ago

    I much more like the cross-platform (and completely free) SendEmail. Did I mention it's written in Perl and there's an EXE for windows platforms?
    http://caspian.dotconf.net/menu/Software/SendEmail/

Leave a reply

Please enclose code in pre tags

Your email address will not be published. Required fields are marked *

*

© 4sysops 2006 - 2021

CONTACT US

Please ask IT administration questions in the forums. Any other messages are welcome.

Sending

Log in with your credentials

or    

Forgot your details?

Create Account