GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Net::SMS::Mollie(3) User Contributed Perl Documentation Net::SMS::Mollie(3)

Net::SMS::Mollie - Send SMS messages via the mollie.nl service

  use 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")'

"Net::SMS::Mollie" allows sending SMS messages via <http://www.mollie.nl/>

"new" creates a new "Net::SMS::Mollie" object.

options

baseurl
Defaults to <https://secure.mollie.nl/xml/sms/>, but could be set to, for example, the non SSL URL <http://www.mollie.nl/xml/sms/>.
ua
Configure your own LWP::UserAgent object, or use our default one.
gateway
Defaults to gateway "1". For more information on the mollie.nl gateways, please read <http://www.mollie.nl/docs/help/?id=1>
originator
The sender of the SMS. Could be 14 digits or 11 characters. Defaults to "Mollie", so you most likely do want to override this default.
username
Your mollie.nl username
password
Your mollie.nl password
recipients
Takes an array of phonenumbers to send the message to.
message
The actual SMS text
type
Defaults to normaal, but could be set to normaal, wappush, vcard, flash, binary, or long
deliverydate
"optional" When do you want to send the SMS? Format: yyyymmddhhmmss
url
"optional" Only useful for the wappush type. Specify the URL of the wappush content.
udh
"optional" Only useful for the binary type. Specify the header of the SMS message.

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;

Set 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;

Push numbers in the recipients array

  foreach(qw/1234567890 0987654321 1292054283/) {
     $mollie->recipient($_);
  }

Send 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).

Returns true when the last sending was successful and false when it failed.

Returns the amount of messages actually sent (could be useful with multiple recipients).

Returns 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".

Returns the result message, as provided by mollie.nl, or LWP::UserAgent.

Requires 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";
  }

  • <http://www.mollie.nl/geavanceerd/sms/http/>
  • <http://www.mollie.nl/docs/help/?id=1>

Please report any bugs to <http://rt.cpan.org/Ticket/Create.html?Queue=Net-SMS-Mollie>

M. Blom, <blom@cpan.org>, <http://menno.b10m.net/perl/>

This 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.

2008-08-15 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.