vajiral/php-imap-fetch
Composer 安装命令:
composer require vajiral/php-imap-fetch
包简介
A PHP IMAP Library
README 文档
README
PHP IMAP Fetch is a library for reading email and attachments, primarily using the POP and IMAP protocols.
Installing
N.b. A note on Ubuntu 14.04 (probably other Debian-based / Apt managed systems), the install of php5-imap does not enable the extension for CLI (possibly others as well), which can cause composer to report fetch requires
ext-imap
sudo ln -s /etc/php5/mods-available/imap.ini /etc/php5/cli/conf.d/30-imap.ini
Composer
Installing Fetch can be done through a variety of methods, although Composer is recommended.
"require": {
"vajiral/php-imap-fetch": "*"
}
Sample Usage
This is just a simple code to show how to access messages by using Fetch. It uses Fetch own autoload, but it can (and should be, if applicable) replaced with the one generated by composer.
use BigV\ImapFetch\Server; use BigV\ImapFetch\Message; $server = new Server('imap.example.com', 993); $server->setAuthentication('username', 'password'); /** @var Message[] $message */ $messages = $server->getMessages(); foreach ($messages as $message) { echo "Subject: {$message->getSubject()}", PHP_EOL; echo "Body: {$message->getMessageBody()}", PHP_EOL; }
License
Fetch is licensed under the BSD License. See the LICENSE file for details.
Originally taken from https://github.com/tedious/Fetch and added couple of extra features that I needed. All credits go to the original owner.
统计信息
- 总下载量: 14
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2020-01-15