perl利用pop3 收取邮件

栏目: Perl · 发布时间: 7年前

内容简介:电脑缺少cpan> install Mail::POP3Client

背景:公司需要开发一套大型客服系统

需求为100个客服同时回复N个用户的 邮件 ,所以找个 perl

来自动读取一个特定邮箱的

邮件

比如service@java-er.com

#!/usr/bin/perl -w
use strict;
use Mail::POP3Client;
 
my $pop;
my $num_mesg;
my $i;
my $username;
 
our $mail_host  = 'imap.exmail.qq.com';  
our $mail_user  = 'yuexiaosheng@java-er.com';  
our $mail_pass  = '8888899999';  
 
my $pop = new Mail::POP3Client( $mail_user, $mail_pass, $mail_host );
 
$num_mesg = $pop->Count;	#How many messages are there?
print ("You have ".$num_mesg." new messages.\n");
 
exit();
for ($i = 1; $i <= $num_mesg; $i++) {
print $pop->Head($i), "\n";	#print header for each message
}

电脑缺少 mail 包的同学

perl -MCPAN -eshell

cpan> install Mail::POP3Client

参考我的 perl 另外一个文章 https://java-er.com/blog/perl-read-url-connect-lwp/

如果你是一名技术人员可加我QQ 2651-0442-02,如果你是 java 技术人还可以加入QQ群 1784-9136-0

首发地址:月小升博客 –无特殊说明,文章均为月小升原创,欢迎转载,转载请注明本文地址,谢谢

以上所述就是小编给大家介绍的《perl利用pop3 收取邮件》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Introduction to Linear Optimization

Introduction to Linear Optimization

Dimitris Bertsimas、John N. Tsitsiklis / Athena Scientific / 1997-02-01 / USD 89.00

"The true merit of this book, however, lies in its pedagogical qualities which are so impressive..." "Throughout the book, the authors make serious efforts to give geometric and intuitive explanations......一起来看看 《Introduction to Linear Optimization》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具