<?php

$msg = '';
if( $_REQUEST["mensaje"] ) {  $msg = $_REQUEST['mensaje'];}

$msg = wordwrap($msg,70);

$para      = 'atiribocchi@ccfc.com.uy';
$titulo    = 'UPM - Alerta nivel ruido';
$mensaje   = $msg;
$cabeceras = 'From: administrador@IMservices.com' . "\r\n" .
    'Reply-To: administrador@IMservices.com' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

mail($para, $titulo, $mensaje, $cabeceras);



$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.sms.to/sms/send",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS =>"{\n    \"message\": \"" . $msg ."\",\n    \"to\": \"+59899288203\",\n    \"sender_id\": \"SMSto\",\n    \"callback_url\": \"https://example.com/callback/handler\"\n}",
  CURLOPT_HTTPHEADER => array(
      "Content-Type: application/json",
      "Accept: application/json",
    "Authorization: Bearer dnoxssST6DUWrn5BdJdjizP9c4EukNX9"
    ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;







?>