$to, "subject" => "Email Preview: $file", "message" => $content, "secret" => "YyyYyHgy765765757yyyyYYYy0Wm08p4bT(qwyRGq", ]; $url = "https://sendmail.ofco.cloud/send-email"; $c = curl_init($url); curl_setopt($c, CURLOPT_HEADER, false); curl_setopt($c, CURLOPT_RETURNTRANSFER, true); curl_setopt($c, CURLOPT_HTTPHEADER, ["Content-type: application/json"]); curl_setopt($c, CURLOPT_POST, true); curl_setopt($c, CURLOPT_POSTFIELDS, json_encode($payload)); $json_response = curl_exec($c); curl_close($c); $res = json_decode($json_response); var_dump($res); }