"; $message['to'] = $email; $message['h:Reply-To'] = $from; $message['subject'] = $subject; $message['html'] = $msg; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $config['api_url']); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); curl_setopt($ch, CURLOPT_USERPWD, "api:{$config['api_key']}"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $message); $result = curl_exec($ch); curl_close($ch); return $result; } $postdata = file_get_contents("php://input"); $request = json_decode($postdata); echo send_mail($request->to, $request->subject, $request->msg, $request->from); ?>