use LWP::UserAgent;
use Encode;
my $ua = LWP::UserAgent->new;
$phone=$ARGV[0];
$cc=$ARGV[1];
$ua->timeout(10);
$ua->env_proxy;
$ua->agent("Mozilla/8.0");
$host = "http://sh2.ipyy.com/sms.aspx?action=send&userid=5409&account=sc10624&password=c1062411mobile=$phone&content=$cc&sendTime=&extno=";
my $response = $ua->get($host);
$ua->default_headers;
if ($response->is_success) {
#my $str=encode("gbk",decode("utf8","$r"));
#my $r=$response->decoded_content);
print encode("gbk",decode("utf8",$response->content)); # or whatever
}
else {
die $response->status_line;
}
C:>perl ./a2.pl 18072722237 888
<?xml version="1.0" encoding="utf-8" ?>
<returnsms>
<returnstatus>Faild</returnstatus>
<message>鐢ㄦ埛鍚嶉敊璇?/message>
<remainpoint>0</remainpoint>
<taskID>0</taskID>
<successCounts>0</successCounts>
</returnsms>