PHP code example of cnorton-webdev / easy-mailinator
1. Go to this page and download the library: Download cnorton-webdev/easy-mailinator library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
cnorton-webdev / easy-mailinator example snippets
$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