GetRefreshToken($config['primary']); $esi = $esiHelper->SetupEsiAuthentication($refreshToken); try { $response = $esi->setBody([ 'approved_cost' => 100, 'body' => "Welcome to this test message.", 'recipients' => [[ 'recipient_id' => $config['primary'], 'recipient_type' => 'character', ]], 'subject' => 'Just a Test', ])->invoke('post', '/characters/{character_id}/mail/', [ 'character_id' => $config['primary'], ]); } catch(RequestFailedException $e) { return null; } dd($response->getErrorCode()); } }