shklyaev-p-a/imap-mail-recipient
Composer 安装命令:
composer require shklyaev-p-a/imap-mail-recipient
包简介
get access to mailbox via imap for reading and flaggind mail message with any format decode
README 文档
README
#About It`s activity developing library for simple getting mail via php imap function.
Attention
Methods and arguments constantly changing. The library is under development
Attention
For joint development contact with me: shklyaev.p.a@mail.ru
#Connect to mailbox
<?php
require('vendor/autoload.php');
use ImapRecipient\Client;
$client = new Client('email', 'password', 'server');
$client->connect();
At this moment available connection to yandex, mail and google mailbox domains. For another server connection need passed to function server adress as third argument. Example: '{imap.mail.ru:993/imap/ssl}'
For check official servers domain use \ImapRecipient\Helpers\AdressParser::getMailBox('email') helper. But imap domain will can be find in google.
#Get all mails from mailbox method will return array with mail number. For get mail you need use getOne() method
$client->all()->get();
for filtering mails before getting you may used special imap filters in main query.
Example:
$client->all()->answered()->body('Hello world')->get();
full filtering list u can find on https://www.php.net/manual/ru/function.imap-search.php
All dates format in filters must be as 'j F Y H:m:s'
#Get one mails with attachments
$client->getOne(int $number);
$client->getOne(int $number)->text() or $client->getOne(int $number)->html()
$client->getOne(int $nubmer)->attachments;' for looking attachments
$images = $client->getOne(int $number)->images()[0]->get() for get image content (similarly for another files implements MediaInterface)
test running: php ./vendor/bin/phpunit or composer test
统计信息
- 总下载量: 17
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-08-09