5% assure discount from here only

Thursday, January 27, 2011

(16) How to send SMS from perl script?

Solution :

To send sms you need a gateway that is willing to accept your message and dispatch to the respective networks. For this you need to register and stuff which is a tedious process.

It is very simple to send a SMS from perl script, there are so many ways to do that. Out of them i am going to post some of the ways for the same.

(1) Send SMS via 160By2

To use this script only 2 thing are required :

(i) CPAN module Net::SMS::160By2
(ii) An A/C with http://www.160by2.com/

use Net::SMS::160By2;

my $obj = Net::SMS::160By2->new($username, $password);

$obj->send_sms($msg, $to);

This is how you can send SMS to any mobile number in
India, Kuwait, UAE, Saudi, Singapore, Philippines & Malaysia at present.

(2) Send SMS via Way2SMS

To use this script only 2 thing are required :

(i) CPAN module Net::SMS::WAY2SMS;
(ii) An A/C with http://www.way2sms.com/

use Net::SMS::WAY2SMS;

my $s = Net::SMS::WAY2SMS->new(
'user' => 'xyz' ,
'password' => 'xyzpassword',
'mob'=>['98********', '9**********']
);

$s->send('Hello World');

3 comments:

  1. i am trying to run code in eclipse i am getting this error i am using windows 7.
    Fatal: failed to find source perl5db.pl for epic_breakpoints.pm

    ReplyDelete
  2. Perl doesn't stand for what you have said. It is just a backronym to fit those four letters.

    Just like we say full form of Maths, Japan etc. which is nothing but backronyms not the acronyms!

    ReplyDelete
  3. Nice blog!! I hope you will post more articles like this!!

    PERL Scripting Online Training

    ReplyDelete