NAME
Net::SMS::Cellsynt - Send SMS through Cellsynt SMS gateway
SYNOPSIS
use Net::SMS::Cellsynt;
$sms = Net::SMS::Cellsynt->new(
origtype=>'alpha',
orig=>'zibri',
username=>'foo',
password=>'bar',
);
$sms->send_sms(
to=>$recipient,
text=>'this text is being sent to you bu Net::SMS::Cellsynt',
);
DESCRIPTION
Net::SMS::Cellsynt provides a perl object oriented interface to the Cellsynt SMS HTTP API, which allows you to send SMS from within your script or application.
To use this module you must have a Cellsynt account.
CONSTRUCTOR
new( parameters )
MANDATORY PARAMETERS
- username => $username
-
Your Cellsynt username.
- password => $password
-
Your Cellsynt password.
- origtype => $origtype
-
Type of originator. This can be either "alpha", where you supply a string in orig parameter that the recpient will see as sender (note that the recipient cannot answer this types of SMS); numeric, where you supply a telephone number in the orig parameter and shortcode where you supply a numerical short code for a operator network.
- orig => $orig
-
This is the "sender" the recpient sees when recieving the SMS. Depending on the value of origtype this should be a string, a telephone number or a numerical shortcode. (See origtype)
OPTIONAL PARAMETERS
- ttl
-
This value determines how long the SMS can be tried to be delivered, in seconds. If this value is above the operator's max value, the operator's value is used. Default is not set.
- concat
-
Setting this to a value above 1 will allow for longer SMS:es to be sent. One SMS can use 153 bytes, and with this you can send up to 6 SMS:es (918 bytes).
- simulate
-
If set to a value other than 0, the module will output the URI that would be used if this wasn't a simulation, and return, when callng the send_sms subroutine. Default is 0.
- uri
-
Set an alternative URI to a service implementing the Cellsynt API. Default is "https://se-1.cellsynt.net/sms.php".
METHODS
send_sms(to=>$recipient, $text=>"msg")
Will send message "msg" as an SMS to $recipient, unless the object has set the simulate object; then the send_msg will output the URI that would be used to send the SMS.
$recipient is a telephone number in international format: The Swedish telephonenumber 0700123456 will translate into 0046700123456 --- it is the caller's responsibility to convert numbers into this format before calling send_sms.
Will return a tracking ID if successfull (or 1 if simulating), or undef if an error occurs, and also write the error message to stderr.
sender(origtype=>$origtype, orig=>$orig)
Update sender. See constructor documentation for valid values.
SEE ALSO
http://cellsynt.com/
COPYRIGHT
Copyright (c) 2009-2010, Olof 'zibri' Johansson <zibri@cpan.org> All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.