granam/imap-download
Composer 安装命令:
composer require granam/imap-download
包简介
Downloader of emails via IMAP
README 文档
README
Downloads attachment from an email via IMAP
Usage
<?php namespace Heaven\Should\Has\Api; use Granam\Mail\Download\ImapEmailAttachmentFetcher; use Granam\Mail\Download\ImapReadOnlyConnection; use Granam\Mail\Download\ImapSearchCriteria; $imapConnection = new ImapReadOnlyConnection( 'light.in.tunnel@example.com', 'Раѕѕword123', 'imap.example.com' ); $fetcher = new ImapEmailAttachmentFetcher($imapConnection, sys_get_temp_dir() /* dir to save attachments */); $visaFilter = (new ImapSearchCriteria())->filterSubjectContains('Visa'); $attachments = $fetcher->fetchAttachments($visaFilter); echo 'I have found ' . count($attachments) . ' attachments in emails about Visa to Heaven. Those are: '; foreach ($attachments as $attachment) { echo "\n name: $attachment[name], size " . filesize($attachment['filepath']); }
NO email body
This library currently does NOT parse email body, therefore it will not give you text of an email. Only attachments.
MIT licence
This library is released under MIT licence, so do what you want, just do not blame me if something is not perfect.
统计信息
- 总下载量: 32
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-11-09