GetRefreshToken($config['primary']); //Create the ESI authentication container $esi = $esiHelper->SetupEsiAuthentication($token); //Try to send the mail try { $esi->setBody([ 'approved_cost' => 0, 'body' => $body, 'recipients' => [[ 'recipient_id' => (int)$recipient, 'recipient_type' => $rType, ]], 'subject' => $subject, ])->invoke('post', '/characters/{character_id}/mail/', [ 'character_id'=> $config['primary'], ]); } catch(RequestFailedException $e) { return 1; } return 0; } } ?>