5% assure discount from here only

Tuesday, January 25, 2011

(13) How to fetch gmail content?

Solution :

Now you can access gmail contents via PERL scripting and can put content accordingly.

use WWW::Mechanize;
$mech = WWW::Mechanize->new;
$mech->get( "https://www.gmail.com/" );
$mech->content();
$mech->submit_form(
form_number => '1',
fields => {
Email => $username,
Passwd => $password,
}
);

my $inbox_url = "https://mail.google.com/mail/?ui=html&zy=e";
$mech->get($inbox_url);
$mailbox = $mech->content();

1 comment:

  1. I get an SLL error on this line:

    $mech->get( "https://www.gmail.com/" );

    Any ideas?

    ReplyDelete