Tried below simple ones
my $sms = Net::SMS::WAY2SMS->new(
'user' => 'user_name' ,
'password' => 'secret_password',
'mob' => ['1234567890', '0987654321']
# multi line sms
my $username = "9823763544";
my $password = "sssssss";
my $msg = "Hi";
my $to = "9922334455";
my $obj = Net::SMS::160By2->new($username, $password);
The reason why
Net::SMS::WAY2SMS is not working is the issue with module. There is no standard API being provided by Way2SMS team, and they keep changing their interface. That is why all the Android apps related to Way2SMS also stop working after a month or two (as soon as Way2SMS team changes interface). As long as Way2SMS doesn't provide an API, you'll not get a stable solution.
Same issue with 160By2.
Line 196 of 160By2.pm is
$form->action($sendsms_submit_uri); and the error you get is
can't call method "action" on undefined values. That means
$form is undefined.
In module author has used
our $SENDSMS_URL = 'http://160by2.com/FebSendSMS';
$mech here is trying to get the above URL.
my $sendsms_uri = URI->new($SENDSMS_URL); $mech->get($sendsms_uri->as_string);`
and then at the end it does
my $form = $mech->form_name('frm_sendsms'); and
But if you notice the
404 error (This URL doesn't even exist). Hence it gives error.