They say my request is never arriving and to check my server/router etc.
The PC can browse to the location or around the net fine, so from that I am assuming I do not have any router issues
I get no compile or other errors when the script is run, just HTTP error returned on the command line.
Do I have to set permissions for perl to allow it to access HTTP, I am running from console as root?
The basic perl script is here:
Code: Select all
#!/usr/bin/perl -T
use strict;
use LWP::UserAgent;
use HTTP::Request::Common;
# Txtlocal login details
my $uname = 'adrian@something.com';
my $pword = 'aapsswordl';
# Configuration details
my $test = "0"; # Set to 1 for testing
my $info = "0"; # Flag to switch on/off debug information.
# Data for text message
my $from = "Home Alarm";
my $selectednums = "44123456789";
# A comma separated list of mobile numbers
# with international dialling codes.
# Each number must be PURELY numeric.
my $message = "This is a test message, no panic just let me know you recieved it. Adrian"; # Text message content
my $ua = LWP::UserAgent->new();
my $res = $ua->request
(
POST 'http://www.txtlocal.com/sendsmspost.php',
Content_Type => 'application/x-www-form-urlencoded',
Content => [ 'from' => $from,
'uname' => $uname,
'pword' => $pword,
'info' => $info,
'test' => $test,
'selectednums'=> $selectednums,
'message' => $message
]
);
if ($res->is_error) { die "HTTP Error\n"; }
print "Response:\n\n" . $res->content . "\n\n";
All I get in response is HTTP Error, but no explanation, the tech person at the gateway says it is never arriving and has run the script locally and it works.
So all is pointing at the PC, trying to think of a way to capture what it is sending but again stuck on that. wondering if I could sort of redirect output to a file?
I will admit to having to install manually perl URI, perl HTTP and another as they were not listed in the package manager.
Cheers
Adrian
Edited due to being crap post