|
NAMENet::SMS::PChome - Send SMS messages via the sms.pchome.com.tw service.SYNOPSISuse strict; use Net::SMS::PChome; my $sms = new Net::SMS::PChome; $sms->login('username', 'password', 'auth_code'); $sms->smsRecipient('0912345678'); $sms->smsSend("The SMS be send by PChome SMS Service!"); if($sms->is_success) { print "Successfully sent message to ".$sms->successcount." number!\n"; } else { print "Something went horribly wrong!\n". "Error: ".$sms->resultmessage." (".$sms->resultcode.")". } or, if you like one liners: perl -MNet::SMS::PChome -e 'send_sms("pchome_username", "pchome_password", "auth_code", "recipient", "messages text")' DESCRIPTIONNet::SMS::PChome allows sending SMS messages via <http://sms.pchome.com.tw/>METHODSnewnew creates a new Net::SMS::PChome object.Options
All these options can be set at creation time, or be set later, like this: $sms->username('my_username'); $sms->password('my_password'); $sms->smsType('2'); $sms->smsDeliverydate('200608141803'); # Send SMS at 2006/08/14 PM 06:03. loginSet the username, password and authcode in one go.$sms->login('my_pchome_username', 'my_pchome_password', 'my_pchome_authcode'); # is basically a shortcut for $sms->username('my_pchome_username'); $sms->password('my_pchome_password'); $sms->authcode('my_pchome_authcode'); Without arguments, it will return the array containing username, password and authcode. my ($username, $password, $authcode) = $sms->login(); smsRecipientPush numbers in the recipients arrayforeach(qw/0912345678 0987654321 0912920542/) { $sms->smsRecipient($_); } smsSendSend 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.resultcodeReturns the resulting code.When LWP::UserAgent reports an error, the resultcode will be set to "-999". resultmessageReturns the result message, as provided by sms.pchome.com.tw, or LWP::UserAgent.EXPORTsend_sms SEE ALSOWEBSITEYou can find information about PChome SMS Service at :http://sms.pchome.com.tw/ AUTHORTsung-Han Yeh, <snowfly@yuntech.edu.tw>COPYRIGHT AND LICENSECopyright (C) 2006 by Tsung-Han YehThis library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
Visit the GSP FreeBSD Man Page Interface. |