Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8483061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:59:05+00:00 2026-06-10T19:59:05+00:00

I am trying to send sms through Way2sms using Perl LWP. The login part

  • 0

I am trying to send sms through Way2sms using Perl LWP. The login part is being successful, after which I save the cookies to a local file. The welcome page after being logged in shows a Send SMS link, clicking on which one is redirected to another page with two inputs for mobile number and sms text and a button for submitting and sending the sms. Firebug reveals the page structure as shown in the figure. From the Iframe url and the form’s action attribute, I constructed the form action’s absolute URL and submit the form accordingly, with the cookie stored in the file. However, the sms isn’t sent. What I am doing wrong here? The code is as follows. (The name attributes for the two text inputs are correct, taken by observing the source code in Firebug, although that’s not included in the image)

use LWP::UserAgent;
open f, "> way2sms.txt";
use HTTP::Cookies;
my $cookie_jar = HTTP::Cookies->new(
file => "cookies.txt",
autosave => 1,
);

my $ua = LWP::UserAgent->new(
    agent =>
      'Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20100101 Firefox/14.0.1',
    cookie_jar => $cookie_jar,
);
my $response = $ua->post(
    'http://site2.way2sms.com/contentt/bar/Login1.action',
    {
        username => $user,
        password => $pass,
    }
);

if ( $response->is_redirect ) {
    $response = $ua->get( $response->header('Location') );
    print 5 if $response->decoded_content =~ /Kaustav Mukherjee/i; #prints it, showing that the login is successful
}   
my $smsresp = $ua->post("http://site5.way2sms.com/jsp/quicksms.action",[MobNo=>$mob,textArea=>'Hello World']);

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T19:59:07+00:00Added an answer on June 10, 2026 at 7:59 pm

    WORKING SCRIPT: (Tested on 6/Sep/2012 3:00 PM GMT+5:30)

        use LWP::UserAgent;
        use HTTP::Cookies;
    
        my $ua = LWP::UserAgent->new(agent=>"Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20100101 Firefox/14.0.1");
    
        $ua->cookie_jar({ file => "/absolute/path/to/cookies.txt", autosave => 1 });
        # if windows, use \ instead of /
    
        # $ua->proxy(['http', 'ftp'], 'http://localhost:9666/');
    
        # below line seems to have done the trick
        push @{ $ua->requests_redirectable }, 'POST';
    
        my $response = $ua->post(
                'http://site5.way2sms.com/Login1.action',{
                "username" => "1234567890", # set your username
                "password" => "passwd0123", # set your password
                "userLogin" => "yes",
                "message" => "",
                "mobileNo" => "",
                }
        );
    
        if($response->is_success && $response->decoded_content =~ /Logout/i){ # you can have your name too in place of Logout
                print "Logged in!\r\n";
        }
    
        my $mob = "1234567890"; # mobile to send message to
        my $mes = "Hello! 123."; # message
    
        my $smsresp = $ua->post(
                "http://site5.way2sms.com/quicksms.action",
                {
                        'Action' => 'dsf45asvd5',
                        'HiddenAction' => 'instantsms',
                        'catnamedis' => 'Birthday',
                        'chkall' => 'on',
                        'MobNo' => $mob,
                        'textArea' => $mes,
                });
    
         if ($smsresp->is_success && $smsresp->decoded_content =~ /Submitted/i) {
             print "Sent!\r\n";
         }
    

    P.S. I wish I could get that expired bounty O_o 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to access and send SMS through Wavecom's FXT-009 using Serial Port
I am trying to send sms through device. But it crashes on the line
I am trying to send SMS using a webservice call. But am having errors
I am trying to send an SMS on an iPhone using MFMessageComposeVieController and I
Hello, I am trying to learn Twilio API. When I [send SMS through php][1]
I'm trying to send a sms via a Nokia phone over serial which is
I am actually trying to send SMS using CDYNE and their API. To do
I am trying to write a small program using Qt to send SMS messages
I am trying to send SMS using php's mail() function. Below you will find
I am trying to send sms from java application using SMPPSim as SMS gateway

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.