in reply to Entering Username Password on a website

Taking a look at the html of their front page, the login procedure is quite simple. Ignore the JavaScript .. thats just so they can do cool things if the login fails.

The following code is an adaptation of the example in Cookbook 20.2 but is untested as I have no mail.com account :)

use HTTP::Request::Common qw(POST); use LWP::UserAgent; $ua = LWP::UserAgent->new(); my $req = POST 'http://www.mail.com/scripts/common/proxy.main', [ action => 'login', show_frame => 'Enter', mail_language => 'us', login => 'full@email.address', password => 'yourpassword', ]; $content = $ua->request($req)->as_string; if ($content =~/You Have New Mail/i) { send_an_email() }

Replies are listed 'Best First'.
Re: Re: Entering Username Password on a website
by Mr. Muskrat (Canon) on Sep 18, 2002 at 14:35 UTC
    It doesn't work as is. It needs to be able to get the redirected content. On my account, http://www.mail.com/scripts/common/proxy.main redirects to http://mail02.mail.com/scripts/common/outblaze.main and the redirect breaks this script. I seem to remember someone getting a redirect to work with LWP though.

      To enable redirection of POST requests: push @{$ua->requests_redirectable}, 'POST';