<?php include '../vendor/autoload.php'; $server = ['id' => 'xxxxxx', 'token' => 'abcdef']; $ms = new SquareMS\Api($server['id'], $server['token']); // It'll try to get ALL mails // Note that this is heavy for the server if getting a lot of records // You can specify $limit and $offset // Or none for default values $history = $ms->getMailHistory(); if ($history) { echo '!> You sent ' . count($history) . " mails since you started using the service ! \n"; } else { echo '!> An error occurred getting your history. \\n'; }