Solved

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

Posted on 2013-12-04
10
2,520 Views
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.

Thanks!
0
Comment
Question by:nti1999
10 Comments
 
LVL 14

Expert Comment

by:John-Charles-Herzberg
ID: 39695639
This is an application to send the SMS or email.

http://www.blat.net/

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 email@mail.com -f email2@mail.com -s "Email Subject" -server my-SQL
0
 

Author Comment

by:nti1999
ID: 39695648
John,

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

Author Comment

by:nti1999
ID: 39696536
John,

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?
0
 
LVL 6

Accepted Solution

by:
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 http://caspian.dotconf.net/menu/Software/SendEmail/

then create a batch file like

start sendemail -f serverroom@boobs.com -t 44123456789@bulksms.co.uk -u password -m Server 42C Exceeded TAKE ACTION -s smtp.ispmail.com

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

http://www.battoexeconverter.com/

works like a charm.
0
 

Author Comment

by:nti1999
ID: 39698165
donnk,

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 emailuser@nticentral.org -t 1234567890@txt.att.net -u email password -m PLUTO Dialer has SUCCESSFULLY terminated -s mailserver.nticentral.local

Thanks.
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 24

Expert Comment

by:lionelmm
ID: 39698234
You can download blat here--works great
http://sourceforge.net/projects/blat/files/
0
 

Author Comment

by:nti1999
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 username@nticentral.org -t 2223334567@txt.att.net;3334445678@messaging.sprintpcs.com -u PLUTO DIALER STATUS -m The PLUTO Dialer software has been SUCCESSFULLY terminated -xu nticentral\username -xp password -s 192.168.1.8:25
0
 
LVL 6

Expert Comment

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

Author Closing Comment

by:nti1999
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!
0
 
LVL 6

Expert Comment

by:donnk
ID: 39699138
your welcome!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Our Group Policy work started with Small Business Server in 2000. Microsoft gave us an excellent OU and GPO model in subsequent SBS editions that utilized WMI filters, OU linking, and VBS scripts. These are some of experiences plus our spending a lo…
In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

911 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now