Perl批量下载Gmail附件的代码(google批量下载插件)不要告诉别人

随心笔谈11个月前发布 admin
91 0

use Mail::POP3Client;

use MIME::Parser;

my $U=’User.Name@gmail.com’;

my $P=’uSeR.pAsSwORd’;

my $X=new MIME::Parser;

$X -> output_dir(‘C:\\download’);    #directory to save attachment

my $G=Mail::POP3Client -> new (

            USER       => $U,

            PASSWORD   => $P,

            HOST       => ‘pop.gmail.com’,

            PORT       => 995,

            USESSL     => ‘true’) or die “Can’t Connect The Server.\n”;

for $i (1 .. $G->Count())

{

    my $C=$G->HeadAndBody($i);

    my $R=$X->parse_data($C);

}

$G->Close();

© 版权声明

相关文章