adistoica / mailinator_php

PHP wrapper for the Mailinator.com API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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_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();
}

License

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

About

PHP wrapper for the Mailinator.com API

License:MIT License


Languages

Language:PHP 100.0%