madbob/automail

SMTP、IMAP和POP3自动配置

安装: 293

依赖项: 0

建议者: 0

安全: 0

星标: 3

关注者: 4

分支: 2

开放性问题: 0

类型:

0.1 2017-08-14 11:22 UTC

This package is auto-updated.

Last update: 2024-09-14 12:13:59 UTC


README

此包封装了Mozilla描述的SMTP、IMAP和POP3自动配置API。

更多信息,请阅读Mozilla文档

安装

composer require madbob/automail

使用方法

require 'vendor/autoload.php';

use AutoMail\AutoMail;
use AutoMail\NotFoundException;

try {
	/*
		Pass your mail address to AutoMail::discover() to obtain an array with
		all available configurations, both for incoming and outgoing messages
	*/
	$configuration = AutoMail::discover('yourmailaddress@libero.it');

	print_r($configuration);

	/*
		[
			'incoming' => [
				[
					'protocol' => 'IMAP',
					'hostname' => 'imapmail.libero.it',
					'port' => 993,
					'socketType' => 'SSL',
					'authentication' => 'password-cleartext',
					'username' => 'yourmailaddress@libero.it'
				],
				[
					'protocol' => 'POP3',
					'hostname' => 'popmail.libero.it',
					'port' => 995,
					'socketType' => 'SSL',
					'authentication' => 'password-cleartext',
					'username' => 'yourmailaddress@libero.it'
				]
			],
			'outgoing' => [
				[
					'protocol' => 'SMTP',
					'hostname' => 'smtp.libero.it',
					'port' => 465,
					'socketType' => 'SSL',
					'authentication' => 'password-cleartext',
					'username' => 'yourmailaddress@libero.it'
				]
			]
		]
	*/
}
catch(NotFoundException $e) {
	echo $e->getMessage();
}

许可证

此代码是免费软件,许可协议为GNU通用公共许可证版本3(GPLv3)。有关更多详细信息,请参阅LICENSE.md文件。

版权 (C) 2017 Roberto Guido bob@linux.it