johnsn/guerrillamail

PHP 5.4+ 的简单 GuerrillaMail 库

1.0 2015-04-16 16:01 UTC

This package is not auto-updated.

Last update: 2024-09-14 13:50:20 UTC


README

一个简单的 GuerrillaMail 库。

Build Status

需求

  • PHP 5.3+,然而,推荐使用 PHP 5.5。
  • 如果使用 CurlConnection 类,则需要 PHP 的 curl 扩展。

安装

此库使用 composer,您可以按照以下方式安装:

{
    "require": {
        "johnsn/guerrillamail": "version"
    }
}

将版本替换为您想要的版本或分支。
您可以在项目的 packagist 页面 上找到更多安装详情。

示例用法

<?php
require_once __DIR__.'/vendor/autoload.php';

use GuerrillaMail\GuerrillaConnect\CurlConnection;
use GuerrillaMail\GuerrillaMail;

//The first parameter is the client's IP.
//The second parameter is the client's Browser Agent.
//There is an optional third parameter to set the api endpoint
//There's an optional fourth parameter to set the site domain
//There's an optional fifth parameter to set the API key (only needed if site access is set private)
$connection = new CurlConnection("127.0.0.1", "GuerrillaMail_Library");

//The second parameter is the client's sid (optional)
$gm = new GuerrillaMail($connection);

//Obtain an email address
$response = $gm->get_email_address();

//Fetch user's latest emails.
$emails = $gm->check_email();

待办事项

由于日程繁忙,我已经有一段时间没有为这个库提供应有的关注了,以下是我将在未来一两个月内关注的几个问题。

不分先后顺序

  • 解耦传输与客户端,当前依赖于不正确的 CurlClient。
  • 迁移到最新的 guzzle http 客户端
  • 使用中间件进行认证
  • 更好的文档和示例

外部链接

GuerrillaMail - Guerrilla Mail API 文档

https://grr.la/ryo/guerrillamail.com/login/ - 注册/登录以获取 API 密钥。(自定义域需要 API 密钥。)

许可证

此项目采用 MIT 许可证。