thepieterdc/mailinator_php

Mailinator.com API 的 PHP 封装

v1.0.3 2016-06-20 14:49 UTC

This package is not auto-updated.

Last update: 2024-09-24 04:30:22 UTC


README

Software License Monthly downloadsDaily downloadsTotal downloads

Mailinator.com API 的 PHP 封装

令牌

创建一个 Mailinator 账户,登录,并在 https://www.mailinator.com/settings.jsp 找到您的令牌

需求

您需要在服务器上安装 cURL 扩展。PHP 5.2 即可满足。

使用方法

require_once 'src/Mailinator/Mailinator.php';
$mailinator = new Mailinator('my_token');

//Get messages in inbox//
try
{
  print_r($mailinator->inbox('randominbox'));
} catch(Exception $e) {
  // Process the error
  echo "Something went wrong: " . $e->getMessage();
}

//Get a message//
try
{
  print_r($mailinator->message('mail-id'));
} catch(Exception $e) {
  // Process the error
  echo "Something went wrong: " . $e->getMessage();
}

//Delete a message//
try
{
  print_r($mailinator->delete('mail-id'));
} catch(Exception $e) {
  // Process the error
  echo "Something went wrong: " . $e->getMessage();
}

许可证

MIT 许可证 (MIT)。更多信息请参阅 许可证文件