oyepez003/mailinator_php

Mailinator.com API 的 PHP 封装

v1.0.3 2016-06-06 13:56 UTC

This package is auto-updated.

Last update: 2024-08-28 12:00:39 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)。有关更多信息,请参阅 许可证文件