Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,160,968 members, 7,845,122 topics. Date: Thursday, 30 May 2024 at 12:37 PM

How To Send SMS From Perl Using HTTP Request - Web Market - Nairaland

Nairaland Forum / Science/Technology / Webmasters / Web Market / How To Send SMS From Perl Using HTTP Request (583 Views)

How To Send Bulk Sms For FREE Through Whatsapp Online Messenger Software / SMS Hub Of Wordpress, Sell, Share & Send SMS / Stop Paying Someone Else To Send Bulksms, You Too Can Have Your Own Portal Now! (2) (3) (4)

(1) (Reply)

How To Send SMS From Perl Using HTTP Request by thomasqueen: 10:12am On Jan 23, 2013
Hey guys. For my project, I needed to find a way to send SMS messages from Perl. It turns out, it is easy to send messages from Perl using HTTP requestes and a software called Ozeki NG SMS Gateway.
To send SMS messages from Perl using HTTP requests, first you need to download, install and configure Ozeki NG SMS Gateway software to your computer. Then import the source code provided below into a new project you write in Perl. After you imported it you can configure the code. You need to customize the values in the source code below.

#!/usr/bin/perl



###############################################

## Ozeki NG - SMS Gateway Perl example ##

###############################################



use HTTP::Request;

use LWP::UserAgent;

use URI::Escape;





###############################################

### Ozeki NG informations ###

###############################################

$host = "127.0.0.1";

$port = "9501";

$username = "admin";

$password = "abc123";

$recipient = "+00123456";

$message = "Test Message from Perl";





###############################################

### Putting together the final HTTP Request ###

###############################################

$url = "http://" . $host;

$url .= ":" . $port;

$url .= "/api?action=sendmessage&";

$url .= "username=" . uri_escape($username);

$url .= "&password=" . uri_escape($password);

$url .= "&recipient=" . uri_escape($recipient);

$url .= "&messagetype=SMS:TEXT";

$url .= "&messagedata=" . uri_escape("HELLO WORLD"wink;





################################################

#### Sending the message ###

################################################

$request = HTTP::Request->new(GET=>$url);

$useragent = LWP::UserAgent->new;

$response = $useragent->request($request);





################################################

### Verifying the response ###

################################################

if ($response->is_success) {

print "Message successfully sent"

} else {

print "Message not sent! Please check your settings!"

}


You can find more info here: http://ozekisms.com/index.php?owpn=608
I hope this will be as useful to you as it is for me! Thomas

(1) (Reply)

Website Designing Nigeria / I Want To Build Up My Portfolio - Let Me Design A Website For You / What Do you Have To say About Yahoo's New Logo

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 10
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.