源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

Perl批量下载Gmail附件的代码

  • 时间:2021-06-21 17:11 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:Perl批量下载Gmail附件的代码
最近在写一个从gmail批量下载附件的程序,用到了 Mail::POP3Client 和 MIME::Parser 2 个模块 实现代码:
[u]复制代码[/u] 代码如下:
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();
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部