基本信息
源码名称:java读取邮件信息
源码大小:4.12KB
文件格式:.zip
开发语言:Java
更新时间:2020-07-20
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300

本次赞助数额为: 2 元 
   源码介绍
// 解析所有邮件 for (int i = 0, count = messages.length; i < count; i  ) {
    MimeMessage msg = (MimeMessage) messages[i]; log.info("------------------解析第"  msg.getMessageNumber() "封邮件-------------------- "); log.info("主题: "  getSubject(msg)); log.info("发件人: "  getFrom(msg)); log.info("收件人:"  getReceiveAddress(msg, null)); log.info("发送时间:"  getSentDate(msg, null)); log.info("是否已读:"  isSeen(msg)); log.info("邮件优先级:"  getPriority(msg)); log.info("是否需要回执:"  isReplySign(msg)); log.info("邮件大小:"  msg.getSize() * 1024  "kb"); boolean isContainerAttachment = isContainAttachment(msg); log.info("是否包含附件:"  isContainerAttachment); if (isContainerAttachment) {
        File file = new File(destDir); if (!file.exists()) {
            file.mkdirs();
        } saveAttachment(msg, destDir); //保存附件  }
    StringBuffer content = new StringBuffer(30); getMailTextContent(msg, content); log.info("邮件正文:"  (content.length() > 100 ? content.substring(0, 100) "..." : content)); log.info("------------------"  msg.getMessageNumber() "封邮件解析结束-------------------- ");
}