SUPPORT THE SITE WITH A CLICK

Subscribe Rss:

SUPPORT THE SITE WITH A CLICK

Sunday, October 21, 2007

How to Send Sms using "Perl Script"

#!/usr/bin/perl
use HTTP::Request::Common qw(POST);
use LWP::UserAgent;
my $url_sendsms = "http://www.abc.oom";
my($ua,$request,$response,%field);
undef %field;
$field{uname} = "srishti";
$field{pass} = "selvaraj";
$field{domain_id} = "srishti";
$field{api_key} = "6g4g18c4e4587a";
$field{send}="9916387638";
$field{dest}="9980902131";
$field{msg}="hi thillai got it";
$ua = LWP::UserAgent->new;
push @{ $ua->requests_redirectable },'POST';
$request = POST $url_sendsms,\%field;
$response = $ua->request($request);
if($response->is_success) {
print $response->as_string;
}
else
{
print "Failed: ", $response->status_line, "\n";
}