#!/usr/bin/perl use WWW::Mechanize; my $mechObj = WWW::Mechanize->new(); if( scalar(@ARGV) ne 4) { help(); } my $username = $ARGV[0]; my $password = $ARGV[1]; my $recvNo = $ARGV[2]; my $textMsg = $ARGV[3]; $mechObj->get("http://wwwl.way2sms.com/content/index.html"); unless( $mechObj->success() ) { exit; } $mechObj->form_number(1); $mechObj->field('username', $username); $mechObj->field('password', $password); $mechObj->submit_form(); $mechObj->get("http://wwwl.way2sms.com//jsp/InstantSMS.jsp?val=0"); $mechObj->form_number(1); $mechObj->field("MobNo",$recvNo); $mechObj->field("textArea",$textMsg); $mechObj->submit_form(); if($mechObj->success()) { print "Done \n"; } else { print "Failed \n"; } sub help { print "\nUsage:\n"; print "\tScriptname.pl \n"; exit(0); }