Is there a way to send a SMS message via a batch script?

Posted on 2013-12-04
Last Modified: 2013-12-05
We have a "Scheduled Task" that is supposed to run every night to shut down a specific program running on a few of our older XP systems. For the most part the batch script runs w/o issue; but there are times when it doesn't and we won't know until it is too late.

Is there a way to configure the batch file to fire off an email/sms to a specified address informing us that the script ran correctly? If so...can somebody provide an example of the way the code should be presented in the batch file? Also if there any programs out there that will enable this functionality I'd be open to suggestions.

Question by:nti1999
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 14

Expert Comment

ID: 39695639
This is an application to send the SMS or email.

Blat is a Windows (32 & 64 bit) command line utility that sends eMail using SMTP or post to usenet using NNTP.

Then in your batch file, you would have a line like the following:

blat -to -f -s "Email Subject" -server my-SQL

Author Comment

ID: 39695648

Thank you for the quick follow-up. We'll give that a shot and provide a status asap.

Author Comment

ID: 39696536

I've been to the site you've referenced; but I can't find any installation files for blat. Unless I'm missing something. I looks as if it's just a bunch of code that needs to be imported into the registry.

How can I get the system to recognize the "blat" commands?
Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.


Accepted Solution

donnk earned 500 total points
ID: 39697573
we use something similar to warn of temps in the sevre rooms, we have an account with a SMS gateway that allows emails 2 SMS:

Grab sendemail for free

then create a batch file like

start sendemail -f -t -u password -m Server 42C Exceeded TAKE ACTION -s

We then turn the bat into an exe file using the free utility below as task scheduler is prissy about batch files

works like a charm.

Author Comment

ID: 39698165

Thanks for the response. I've downloaded the "sendemail" files and placed them in the same folder has my .bat file; but it doesn't seem to be working. We have our own Exchange server on the same network; so I don't think we need an outside "email gateway" service. Not to mention I've never been strong with scripting. Here is the coding I'm using for the batch file below. Can you please provide some guidance on how to get it working?

start sendemail -f -t -u email password -m PLUTO Dialer has SUCCESSFULLY terminated -s mailserver.nticentral.local

LVL 25

Expert Comment

by:Lionel MM
ID: 39698234
You can download blat here--works great

Author Comment

ID: 39698327
Almost there. I've been able to get "SendEmail" working with my gmail address and gmail's smtp server; but I'm having some issues with getting it to work/communicate with our internal Exchange server. Here's the syntax.

start sendemail -f -t; -u PLUTO DIALER STATUS -m The PLUTO Dialer software has been SUCCESSFULLY terminated -xu nticentral\username -xp password -s

Expert Comment

ID: 39698466
bypass exchange and use your ISP mail server or gmail smtp server.

Author Closing Comment

ID: 39699102
I've completely bypassed the Exchange server and set up a separate gmail address and this solution worked perfectly. I also used the bat to exe utility to convert the batch file.

Thank you!

Expert Comment

ID: 39699138
your welcome!

Featured Post

Is Your DevOps Pipeline Leaking?

Is your CI/CD pipeline a hodge-podge of randomly connected tools? You’ve likely got a tool to fix one problem & then a different tool to fix another, resulting in a cluster of tools with overlapping functionality. Learn how to optimize your pipeline with Gartner's recommendations

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question