Perl批量下载Gmail附件的代码
最近在写一个从gmail批量下载附件的程序,用到了 Mail::POP3Client 和 MIME::Parser 2 个模块
实现代码:
代码如下:
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();
相关推荐
边城客栈学无止境 2020-07-05
Walter的学习笔记 2020-07-04
A宇 2020-06-14
边城客栈学无止境 2020-06-10
邓博学习笔记 2020-06-03
davidliu00 2020-05-26
ShiShuo 2020-05-16
Aggressivesnail 2020-05-10
ShiShuo 2020-04-26
hanxingwang00 2020-04-22
davidliu00 2020-03-06
ShiShuo 2020-03-06
ShiShuo 2020-03-05
Aggressivesnail 2020-02-28
aaLiweipeng 2020-02-01
amberom 2020-01-16
Walter的学习笔记 2020-01-06