Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Sending special characters to sms using Perl

by flexvault (Parson)
on Oct 23, 2012 at 16:26 UTC ( #1000496=note: print w/ replies, xml ) Need Help??


in reply to Sending special characters to sms using Perl

Ombongi.Moraa,

I wrote this code in 2004/5. I would do it much different now, but it's worked since and I never even looked at it until your question. We monitor routers, switches, servers, etc. and it something doesn't respond correctly, we use the script to send a message to the support cell phone. The number in the sample is invalid.

#!/usr/local/bin/perl -w our $log = "/log/sms_emails"; open (CLOG, ">>$log") || die "Could not open-1 $log File\n"; our $ErrCode = "@ARGV"; if ( $ErrCode eq "" ) { print "format is: pyrsms.cgi message-text\n";exit(1); } $rno = time; $usermailmsg = "/tmp/SMS_msg_$rno"; $filout = "$usermailmsg"; open (f_out, ">$filout") || die "Could not open-3a $filout\n"; $PFemail = "9083972845\@messaging.sprintpcs.com"; $ltm = localtime; print f_out "Subject: Error Code: $ErrCode\n\n\n"; close f_out; print CLOG "$ltm\t$PFemail\t$ErrCode\t$usermailmsg\n"; system("/usr/sbin/sendmail $PFemail < $usermailmsg"); sleep 1; system("/usr/sbin/sendmail -v -q 1>>/dev/null 2>>/dev/null");

Maybe something in the code will help you figure out what you need.

Good Luck!

"Well done is better than well said." - Benjamin Franklin


Comment on Re: Sending special characters to sms using Perl
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1000496]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2014-08-30 17:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (293 votes), past polls