Posted By

smsmatrix on 07/10/10


Tagged

perl sms gateway


Versions (?)

send SMS via SMS Gateway by www.smsmatrix.com


 / Published in: Perl
 

URL: http://www.smsmatrix.com/?sms-gateway

send SMS to any mobile phone number (or a list) worldwide.

  1. use LWP::UserAgent;
  2. use HTTP::Request::Common;
  3.  
  4. my $ua = LWP::UserAgent->new();
  5. my $res = $ua->request
  6. (
  7. POST 'http://www.smsmatrix.com/matrix',
  8. Content_Type => 'application/x-www-form-urlencoded',
  9. Content => [ 'username' => '[email protected]',
  10. 'password' => 'pass7782',
  11. 'callerid' => '12501231233', # optional (for 2-way sms)
  12. 'phone' => '12506063167',
  13. 'txt' => 'this is a test' ]
  14. );
  15.  
  16. if ($res->is_error) { die "HTTP Error\n"; }
  17. print "Matrix API Response: " . $res->content . "\n\n";

Report this snippet  

You need to login to post a comment.