PHP code example of unapi / mailru
1. Go to this page and download the library: Download unapi/mailru 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/ */
unapi / mailru example snippets
use unapi\mailru\Service;
use unapi\mailru\Credentials;
$service = new Service();
$credentials = new Credentials('[email protected]', 'password');
$token = $service->getToken($credentials)->wait();
use unapi\mailru\parser\Mailbox;
/** @var Mailbox $mailbox */
$mailbox = $service->getMailbox($credentials, $token)->wait();
var_dump($mailbox->getBody()->getFolders());
var_dump($mailbox->getBody()->getThreads());