Net::SMS::Clickatell - Access to Clickatell SMS messaging service
use Net::SMS::Clickatell; my $catell = Net::SMS::Clickatell->new( API_ID => $api_id ); $catell->auth( USER => $user, PASSWD => $passwd ); $catell->sendmsg( TO => $mobile_phone, MSG => 'Hi, I\'m using Clickatell.pm' );
Clickatell (http://www.clickatell.com) is a commercial service that allows its users to send SMS messages to anyone in the world. This service supports many ways to send messages, for example HTTP, SMTP and SMPP, among others.
Net::SMS::Clickatell provides OO methods that allow to send SMS messages through Clickatell service.
Note that whether this software nor the author are related to Clickatell in any way.
Creates the Clickatell object.
Usage:
my $catell = Net::SMS::Clickatell->new( API_ID => $api_id );
The complete list of arguments is:
API_ID : Unique number received from Clickatell when an account is created. UseSSL : Tell Clickatell module whether to use SSL or not (0 or 1). BaseURL : Default URL used to connect with Clickatell service. UserAgent : Name of the user agent you want to display to Clickatell service.
Logs in Clickatell service,
$catell->auth( USER => $user, PASSWD => $passwd );
where $user and $password are your credentials for Clickatell service.
This method returns 1 or 0 if we logged in or not .
Sends a message trought Clickatell service.
$catell->sendmsg( TO => $mobile_phone, MSG => $msg );
where $mobile_phone is the mobile phone number that you wants to sends the message (international format, no leading zeros) and $msg is the message's text.
This method return 1 or 0 if we successfully sent the message or not.
Set or retrieve a session identificator number. This number is returned by Clickatell service when a user logs in successfully in the service.
$catell->session_id(); # Retrieve session identificator number or $catell->session_id($sid); # Set session identificator number to $sid
Set or retrieve a message identificator number. This number is returned by Clickatell service is a message was successfully sent.
$catell->msg_id(); # Retrieve message identificator number or $catell->msg_id($mid); # Set message identificator number to $mid
Returns a code that describes the last error ocurred.
Example:
if(my $error = $catell->error) { if($error == 1) { die("Username or password not defined\n"); } elseif ($error == 2) { die("Username or password invalid\n"); } else { die("Unexpected fault\n"); } }
Complete list of error codes:
0 - No error 1 - Username or password not defined 2 - Username or password wrong 3 - Server has problems 4 - The message couldn't be sent
Roberto Alamos Moreno <ralamosm@cpan.org>
Copyright (c) 2004 Roberto Alamos Moreno. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Clickatell is Copyright (c) 2004 Clickatell (Pty) Ltd: Bulk SMS Gateway
This software or the author aren't related to Clickatell in any way.
1 POD Error
The following errors were encountered while parsing the POD:
=back doesn't take any parameters, but you said =back 4
To install Net::SMS::Clickatell, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::SMS::Clickatell
CPAN shell
perl -MCPAN -e shell install Net::SMS::Clickatell
For more information on module installation, please visit the detailed CPAN module installation guide.