亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

Perl批量下載Gmail附件的代碼

 更新時間:2014年06月27日 10:52:52   投稿:junjie  
這篇文章主要介紹了Perl批量下載Gmail附件的代碼,本文重點在使用Mail::POP3Client模塊和Gmail通信的方法,需要的朋友可以參考下

最近在寫一個從gmail批量下載附件的程序,用到了 Mail::POP3Client 和 MIME::Parser 2 個模塊

實現(xiàn)代碼:

復(fù)制代碼 代碼如下:

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();

相關(guān)文章

最新評論