private function _exec($params) {
        $params['key'] = $this->_config['api_key'];
        $params = json_encode($params);

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_USERAGENT, 'Mandrill-PHP/1.0.52');
        curl_setopt($ch, CURLOPT_POST, true);
        if (!ini_get('safe_mode') && !ini_get('open_basedir')){
            curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
        }
        curl_setopt($ch, CURLOPT_HEADER, false);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
        curl_setopt($ch, CURLOPT_TIMEOUT, 600);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

        curl_setopt($ch, CURLOPT_URL, 'https://mandrillapp.com/api/1.0/messages/send.json');
        curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
        curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
        curl_setopt($ch, CURLOPT_VERBOSE, false);

        $response_body = curl_exec($ch);

        if(curl_error($ch)) {
            throw new Exception("API call to messages/send failed: " . curl_error($ch));
        }
        $result = json_decode($response_body, true);
        if($result === null) throw new Exception('We were unable to decode the JSON response from the Mandrill API: ' . $response_body);

        return $result;
    }
private function _exec($params) {
        $params['key'] = $this->_config['api_key'];
        $params = json_encode($params);

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_USERAGENT, 'Mandrill-PHP/1.0.52');
        curl_setopt($ch, CURLOPT_POST, true);
        if (!ini_get('safe_mode') && !ini_get('open_basedir')){
            curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
        }
        curl_setopt($ch, CURLOPT_HEADER, false);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
        curl_setopt($ch, CURLOPT_TIMEOUT, 600);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

        curl_setopt($ch, CURLOPT_URL, 'https://mandrillapp.com/api/1.0/messages/send.json');
        curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
        curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
        curl_setopt($ch, CURLOPT_VERBOSE, false);

        $response_body = curl_exec($ch);

        if(curl_error($ch)) {
            throw new Exception("API call to messages/send failed: " . curl_error($ch));
        }
        $result = json_decode($response_body, true);
        if($result === null) throw new Exception('We were unable to decode the JSON response from the Mandrill API: ' . $response_body);

        return $result;
    }
private function _exec ( $ params ) { $ params [ 'key' ] = $ this -> _config [ 'api_key' ] ; $ params = json_encode ( $ params ) ; $ ch = curl_init ( ) ; curl_setopt ( $ ch , CURLOPT_USERAGENT , 'Mandrill-PHP/1.0.52' ) ; curl_setopt ( $ ch , CURLOPT_POST , true ) ; if ( ! ini_get ( 'safe_mode' ) && ! ini_get ( 'open_basedir' ) ) { curl_setopt ( $ ch , CURLOPT_FOLLOWLOCATION , true ) ; } curl_setopt ( $ ch , CURLOPT_HEADER , false ) ; curl_setopt ( $ ch , CURLOPT_RETURNTRANSFER , true ) ; curl_setopt ( $ ch , CURLOPT_CONNECTTIMEOUT , 30 ) ; curl_setopt ( $ ch , CURLOPT_TIMEOUT , 600 ) ; curl_setopt ( $ ch , CURLOPT_SSL_VERIFYPEER , false ) ; curl_setopt ( $ ch , CURLOPT_URL , 'https://mandrillapp.com/api/1.0/messages/send.json' ) ; curl_setopt ( $ ch , CURLOPT_HTTPHEADER , array ( 'Content-Type: application/json' ) ) ; curl_setopt ( $ ch , CURLOPT_POSTFIELDS , $ params ) ; curl_setopt ( $ ch , CURLOPT_VERBOSE , false ) ; $ response_body = curl_exec ( $ ch ) ; if ( curl_error ( $ ch ) ) { throw new Exception ( "API call to messages/send failed: " . curl_error ( $ ch ) ) ; } $ result = json_decode ( $ response_body , true ) ; if ( $ result === null ) throw new Exception ( 'We were unable to decode the JSON response from the Mandrill API: ' . $ response_body ) ; return $ result ; }
Sending API request

@param array $params
@return array
@throws Exception
Sending API request