|
NAMENet::SMS::Mollie - Send SMS messages via the mollie.nl serviceSYNOPSISuse strict; use Net::SMS::Mollie; my $mollie = new Net::SMS::Mollie; $mollie->login('username', 'p4ssw0rd'); $mollie->recipient('0612345678'); $mollie->send("I can send SMS!"); if($mollie->is_success) { print "Successfully sent message to ".$mollie->successcount." number(s)!"; } else { print "Something went horribly wrong!\n". "Error: ".$mollie->resultmessage." (".$mollie->resultcode.")"; } or, if you like one liners: perl -MNet::SMS::Mollie -e 'send_sms("username", "password", "recipient", "text", "originator")' DESCRIPTION"Net::SMS::Mollie" allows sending SMS messages via <http://www.mollie.nl/>METHODSnew"new" creates a new "Net::SMS::Mollie" object.options
All these options can be set at creation time, or be set later, like this: $mollie->username('my_username'); $mollie->password('my_password'); $mollie->type('wappush'); $mollie->url('some_url'); Without an argument, the method will return its current value: my $username = $mollie->username; my $baseurl = $mollie->baseurl; loginSet the username and password in one go.$mollie->login('my_username', 'my_p4ssw0rd'); # is basically a shortcut for $mollie->username('my_username'); $mollie->password('my_p4ssw0rd'); Without arguments, it will return the array containing username, and password. my ($user, $pass) = $mollie->login; recipientPush numbers in the recipients arrayforeach(qw/1234567890 0987654321 1292054283/) { $mollie->recipient($_); } sendSend the actual message. If this method is called with an argument, it's considered the message. Returns true if the sending was successful, and false when the sending failed (see resultcode and resultmessage).is_successReturns true when the last sending was successful and false when it failed.successcountReturns the amount of messages actually sent (could be useful with multiple recipients).resultcodeReturns the resulting code, as provided by mollie.nl. See <http://www.mollie.nl/geavanceerd/sms/http/> for all possible codes.When LWP::UserAgent reports an error, the resultcode will be set to "-1". resultmessageReturns the result message, as provided by mollie.nl, or LWP::UserAgent.creditsRequires both username and password to be set, and returns the amount of remaining credits (with 4 decimals) or undef:if(my $credits = $mollie->credits) { print $credits." credits left!\n"; } else { print $mollie->resultmessage." (". $mollie->resultcode.")\n"; } SEE ALSO
BUGSPlease report any bugs to <http://rt.cpan.org/Ticket/Create.html?Queue=Net-SMS-Mollie>AUTHORM. Blom, <blom@cpan.org>, <http://menno.b10m.net/perl/>COPYRIGHTThis program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.The full text of the license can be found in the LICENSE file included with this module.
Visit the GSP FreeBSD Man Page Interface. |