28/11
2016
PHP wrapper library for Mailinator.com API
PHP wrapper library for the Mailinator API, (*2)
To obtain an API token for Mailinator, you must first create a Mailinator account. API access then can be obtained by purchasing an upgrade plan here and then obtain your API token at https://www.mailinator.com/settings.jsp, (*3)
In order to use this, you must have the cURL extension installed on your server. PHP 5.5 or higher recommended., (*4)
composer require cnorton-webdev/easy-mailinator
, (*5)
$token = 'your_token_goes_here'; $mail = new easy_mailinator($token); // Retrieve messages for an inbox $name = 'some_name_here'; $messages = $mail->inbox($name); // Show message count - MUST be called AFTER getting messages otherwise will return 0 $message_count = $mail->get_mail_count(); // Get message content $message = $mail->get($msg_id); // Delete a message $is_deleted = $mail->delete($msg_id); // Retrieve saved messages $saved_messages = $mail->saved(); // Get saved messages count - MUST be called AFTER getting messages otherwise will return 0 $saved_count = $mail->get_saved_count();
$token = 'your_token_goes_here'; $mail = new easy_mailinator($token, true); // Retrieve messages for private domain inbox $messages = $mail->private_domain(); // Show private message count - MUST be called AFTER getting messages $private_message_count = $mail->get_private_count(); // Retrieve and delete messages the same as public inbox example