iu-tecmob/php-imap
最新稳定版本:1.0.2
Composer 安装命令:
composer require iu-tecmob/php-imap
包简介
PHP class to access mailbox by POP3/IMAP/NNTP using IMAP extension
README 文档
README
ImapMailbox is PHP class to access mailbox by POP3/IMAP/NNTP using IMAP extension
Features
- Connect to mailbox by POP3/IMAP/NNTP (see imap_open)
- Get mailbox status (see imap_check)
- Receive emails (+attachments, +html body images)
- Search emails by custom criteria (see imap_search)
- Change email status (see imap_setflag_full)
- Delete email
Usage example
<?php require_once('../src/ImapMailbox.php'); // IMAP must be enabled in Google Mail Settings define('GMAIL_EMAIL', 'some@gmail.com'); define('GMAIL_PASSWORD', '*********'); define('ATTACHMENTS_DIR', dirname(__FILE__) . '/attachments'); $mailbox = new ImapMailbox('{imap.gmail.com:993/imap/ssl}INBOX', GMAIL_EMAIL, GMAIL_PASSWORD, ATTACHMENTS_DIR, 'utf-8'); $mails = array(); // Get some mail $mailsIds = $mailbox->searchMailBox('ALL'); if(!$mailsIds) { die('Mailbox is empty'); } $mailId = reset($mailsIds); $mail = $mailbox->getMail($mailId); var_dump($mail); var_dump($mail->getAttachments());
Recommended
- Google Chrome extension PHP Console
- Google Chrome extension JavaScript Errors Notifier
统计信息
- 总下载量: 22
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: LGPL
- 更新时间: 2015-04-05