定制 rdx/imap 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

rdx/imap

Composer 安装命令:

composer require rdx/imap

包简介

Reads and parses e-mail from an IMAP/POP3 source

README 文档

README

Build Status Scrutinizer Code Quality

Reads e-mails on an IMAP server.

Features

  • Retrieves message parts
  • Recognizes PLAIN & HTML parts
  • Recognizes attachments

Uses PHP's built in IMAP module.

Examples

Init connection & find messages:

$mbox = new rdx\imap\IMAPMailbox('example.com', 'user', 'password', 'INBOX', ['ssl', 'tls']);
$messages = $mbox->messages([
	'newestFirst' => true, // bool
	'seen' => false, // null|bool
	'limit' => 10, // int
	'offset' => 0, // int
]);

See a message's structure:

foreach ($messages as $message) {
	echo $message->simpleStructure() . "\n\n";
	
	// Could be something complex like:
	// 1. PLAIN (517)
	// 2. DELIVERY-STATUS (315)
	// 3. *RFC822 (2446)
	// 3.1. PLAIN (610)
	// 3.2. HTML (744)
	
	// Or something simple like:
	// 1. PLAIN (123)
	// 2. JPEG (76543)
}

Find all HTML parts, including attachments, forwards etc:

foreach ($messages as $message) {
	$htmls = $message->html(true); // true for recursive, false for only top level parts
}

Read bounce mail to find rejected addresses:

foreach ($messages as $message) {
	$body = $message->subtypeContent('DELIVERY-STATUS');
	if ($body && strpos($body, 'failed') !== false) {
		// Extract address and do something
	}
}

Find ALL image attachments:

foreach ($messages as $message) {
	$attachments = $message->subtypeParts(['JPEG', 'PNG', 'GIF'], true); // true = recursive
	
	foreach ($attachments as $att) {
		$att->saveAttachment('/some/folder');
	}
}

统计信息

  • 总下载量: 105
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 6
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-03-31

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固