Simple PHP script to send EIR SMS texts via Eir website

The code

<?php

$cookie_file = "cookie.txt";
$eir_username = "xxx@xxx.com";
$eir_password = "QWERTYUIOP";
$mynumber = "+353861112222";
$recipient "$mynumber"; 
$message = "simple text message";


$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, "https://my.eir.ie/login"); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.62 Safari/537.36');
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file);
curl_exec($ch); 
curl_close($ch); 

$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, "https://my.eir.ie/rest/brand/3/portalUser/authenticate"); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "{\"emailAddress\":\"" . $eir_username . "\",\"password\":\"" . $eir_password . "\"}");
curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type:application/json' ) );
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file);
curl_exec($ch); 
curl_close($ch); 

$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, "https://my.eir.ie/mobile/webtext/mobileNumbers/" . $mynumber . "/messages?ts=" . time() ); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "{\"content\":\"" . $message . "\",\"recipients\":[\"" . $recipient . "\"]}");
curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type:application/json' ) );
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file);
curl_exec($ch); 
curl_close($ch);