These forums have been archived and are now read-only.
The new forums are live and can be found at https://forums.eveonline.com/
Esi Mail Curl help..
session_start();$cost = 0;$body = 'Test';$rid = '94547377';$rtype = 'characters';$sub = 'test object';$auth_code = '';function curl_post_group(){ $ch = curl_init(); $url = 'https://esi.tech.ccp.is/latest/characters/94547377/mail/?datasource=tranquility'; curl_setopt($ch, CURLOPT_URL, $url); $header = 'Authorization: Bearer ' . $auth_code; // headers curl_setopt($ch, CURLOPT_HTTPHEADER, array($headers)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($ch, CURLOPT_POST, true); $post ["approved_cost"] = $cost; $post ["body"] = $body; $post ["recipients"] = array(); $post ["recipients"] ["recipient_id"] = $rid; $post ["recipients"] ["recipient_type"] = $rtype; $post ["subject"] = $sub; $post = json_encode($post, JSON_UNESCAPED_UNICODE); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); curl_setopt($ch, CURLOPT_FRESH_CONNECT, true); curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__) . '/cacert.pem'); $response = curl_exec($ch); $response = curl_exec($ch); if (curl_getinfo($ch) ["http_code"] != 201) { echo "Error"; echo " HTTP_CODE:" . curl_getinfo($ch) ["http_code"]; print_r(curl_getinfo($ch)); print_r($response); } curl_close($ch); $response = json_decode($response); return $response;}curl_post_group();
{"error": "'recipients' is required, 'subject' is required, 'body' is required, 'mail' is required"}
Developer of EVEmail
Proud developer of SeAT! A Simple Eve API & Corporation Management Tool.
Project Page: https://github.com/eveseat/seat