Monks:
utilzing LWP to post to messaging.sprintpcs.com/sms
i came up with this code.
why will the message not go through. please add your own sprint phone number
#!/usr/bin/perl -w use strict; require LWP::Protocol::http; require LWP::UserAgent; use LWP::Simple; my $sprint_url = "http://www.messaging.sprintpcs.com/sms/check_message +_syntax.html"; my $pcs_number = "##########"; my $callback_number = "##########"; my $message = "I am a sms phone"; my $email_address = ""; my ($s,$c,$h) = &GetURL( $sprint_url, $pcs_number, $callback_number, $message, $email_address ); print $c, "\n"; sub GetURL { my ($sprint_url,$pcs,$back,$msg,$e) = @_; print "Getting $sprint_url ...\n"; print "$back \t $msg \n"; my $ua = new LWP::UserAgent; # Faking from Netscape 4.05, not perl $ua->agent('Mozilla/4.05 [en] (WinNT; I)'); $ua->proxy(['http', 'ftp'], 'http://hqifwdu1:8080/'); my $testURL = new URI::URL("$sprint_url"); #$request = new HTTP::Request('GET', $testURL); my $request = new HTTP::Request('POST', $testURL); $request->content_type('application/x-www-form-urlencoded'); my $formfields =qq( mobilenum=$pcs callbacknum=$back message= $msg + ack_add= "$e"); print "$formfields \n"; $request->content($formfields); my $response = $ua->request($request, undef, undef); my $str = $response->as_string; my $cont = $response->content; my $head = $response->headers_as_string(); return ($str,$cont,$head); }

In reply to send message to sprint PCS through their site by elzemeyer

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.