Skip to content

Latest commit

 

History

History
39 lines (30 loc) · 1.16 KB

File metadata and controls

39 lines (30 loc) · 1.16 KB

mailinator_php

Software License

PHP wrapper for the Mailinator.com API

Token

Create a Mailinator account, login, and find your token at https://www.mailinator.com/settings.jsp

Requirements

You need to have the cURL-extension installed on your server. PHP 5.2 will suffice.

Usage

require 'Mailinator.php';
$mailinator = new Mailinator('my_token');

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

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

License

The MIT License (MIT). Please see License File for more information.