. * * @package phpservermon * @author Daif Alotaibi * @copyright Copyright (c) 2008-2017 Pepijn Over * @license http://www.gnu.org/licenses/gpl.txt GNU GPL v3 * @version Release: @package_version@ * @link http://www.phpservermonitor.org/ **/ namespace psm\Txtmsg; class Smsgw extends Core { /** * Send a text message to one or more recipients * * @param string $message * @return boolean */ public function sendSMS($message) { $url = 'http://api.smsgw.net/SendBulkSMS'; $post = array( 'strUserName' => $this->username, 'strPassword' => $this->password, 'strTagName' => $this->originator, 'strRecepientNumbers' => implode(';', $this->recipients), 'strMessage' => $message, ); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_HEADER, FALSE); curl_setopt($ch, CURLOPT_POST, TRUE); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); $data = curl_exec($ch); if($data == '1') { $this->success = true; } return $this->success; } }