Send email from batch filesOften times I have jobs that need to be done at regular intervals, and I need a way so send myself an email, or text message when the job is done. Here is a nice utility that I have found that can be added to a batch file that will send an email customized to your needs. The free utility is called Blat.

A nice thing about using Blat for sending emails from a batch files is that you don't need to have an exchange server. Which for me, is the case. Blat is very straightforward to use inside a batch file.

Here is an example:

blat.exe -f This e-mail address is being protected from spambots. You need JavaScript enabled to view it -to This e-mail address is being protected from spambots. You need JavaScript enabled to view it -subject ThisIsTheSubject -body ThisIsTheBody -server smtp.server.com:25 -u SMTPUserLogin -pw SMTPUserPass

Using the command line above, I will get an email notification alert, or if properly configured, an SMS alert.

In my particular application, I am using Servers Alive to ping various servers on our network. If one goes down, Servers Alive sends me an email, as well as a text message (SMS) of the issue at hand.

-- Mike

This article was originally posted on mikestechblog.com. Any reproduction on any other site is prohibited and a violation of copyright laws.