Important alert: (current site time 7/15/2013 8:50:04 PM EDT)
 

VB icon

Send a 1-Way SMS in Perl

Email
Submitted on: 9/27/2001 2:59:24 PM
By: Bob White  
Level: Advanced
User Rating: By 3 Users
Compatibility: 5.0 (all versions), 4.0 (all versions), 3.0 (all versions), Pre 3.0
Views: 29365
(About the author)
 
     Allows you to embed SMS wireless messaging to cell phones and pagers from Perl applications of any type. Uses the Simplewire network to reach 118 countries.

 
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
=**************************************
= for :Send a 1-Way SMS in Perl
=**************************************
Copyright Simplewire
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.
				
=**************************************
= Name: Send a 1-Way SMS in Perl
= Description:Allows you to embed SMS wireless messaging to cell phones and pagers from Perl applications of any type. Uses the Simplewire network to reach 118 countries.
= By: Bob White
=
= Inputs:Message Pin, From, Callback and text.
=
= Returns:Returns Message Status
=
= Assumes:The best way is to join the Simplewire Developer Program at http://devprogram.simplewire.com. Then download the SDK as listed. Then you will receive an email explaining what to do
=
=This code is copyrighted and has= limited warranties.Please see http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=235&lngWId=6=for details.=**************************************

use Net::SMS; 
# Create a new SMS object 
my $r = Net::SMS->new(); 
# Setup the SMS message parameters 
$r->msgPin("+11005101234"); 
$r->msgFrom("Demo"); 
$r->msgCallback("+11005551212"); 
$r->msgText("Hello World from Simplewire!"); 
# Send the SMS message off 
$r->msgSend(); 
# Check out what happened 
if ($r->success) { 
print "Message was successfully sent via Simplewire!\n"; 
} else { 
print "Message was not successfully sent via Simplewire!\n"; 
print "Error Code: " . $r->errorCode . "\n"; 
print "Error Description: " . $r->errorDscr . "\n"; 
} 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Advanced category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
9/28/2001 4:23:44 AMIgor

This posting has nothing about Perl. It is an ad of service a bit over-priced IMHO. I know another provider that is twice cheaper and I am looking for another one of the same price level for redundancy.
(If this comment was disrespectful, please report it.)

 
9/28/2001 11:13:05 AMBob White

Igor, I'm sorry if you felt that this was an ad. However, it truly was targeted to the many users who wish to send wireless messages from Perl. As for the prices of service, different services vary based on different features. Simplewire offers many features not available through other providers, as well as higher reliability. This is just why we allow free evaluation and share our code so that users can decide for themselves. I appreciate your feedback.
(If this comment was disrespectful, please report it.)

 
10/9/2001 7:02:53 PMSon Nguyen

I copy and paste your code in Perl (after change all the = sign to #. I got the error message:


(If this comment was disrespectful, please report it.)

 
10/9/2001 7:05:22 PMSon Nguyen

Can't locate Net/SMS.pm in @INC (@INC contains: /usr/lib/perl5/i386-linux/5.00404 /usr/lib/perl5 /usr/lib/perl5/site_perl/i386-linux /usr/lib/perl5/site_perl .) at ./index.cgi line 29.


Do yo know where can I obtain the SMS.pm module ?
(If this comment was disrespectful, please report it.)

 
11/5/2002 2:55:24 AMcwsoon

can your code br run under coldfusion studio. I try but fail.anywhere to run your code
(If this comment was disrespectful, please report it.)

 
12/20/2002 5:48:23 PM

Useful idea, but attaching a copyright to code that is so completely basic is lame. This is comparable to the "Hello World" program, but for NET::SMS. In that case, I'd like to copyright "Hello World."
(If this comment was disrespectful, please report it.)

 
12/20/2002 5:50:03 PM

Oh, and a more useful demo would include how to install NET:SMS, since it has many other required modules.
(If this comment was disrespectful, please report it.)

 
2/7/2003 6:24:22 AM

Keep the Planet clean! Keep ads out, they are disrespectful.
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.