PHP code example of nhanchaukp / tempmail-edu-php
1. Go to this page and download the library: Download nhanchaukp/tempmail-edu-php 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/ */
nhanchaukp / tempmail-edu-php example snippets
Dotenv\Dotenv;
$dotenv = Dotenv::createImmutable(__DIR__);
$dotenv->load();
use Nhanchaukp\TempmailEdu\Config;
use Nhanchaukp\TempmailEdu\Http\GuzzleClient;
use Nhanchaukp\TempmailEdu\TempmailEdu;
$config = new Config(baseUri: 'https://tempmail.id.vn/api', timeout: 10);
$http = new GuzzleClient($config);
$client = new TempmailEdu($http);
// Now you can call protected endpoints without login(), provided the token in .env is valid
$user = $client->getUser();
print_r($user);
bash
composer