Beispiel #1
0
 /**
  * Verify existence of an email address
  *
  * @param $email
  *
  * @return \Kickbox\HttpClient\Response
  */
 public static function verify($email)
 {
     $key = Config::get('kbox::kickbox_api_key');
     $client = new \Kickbox\Client($key);
     $kickbox = $client->kickbox();
     $response = $kickbox->verify($email);
     return $response;
 }
 /**
  * verify
  * 
  * @param mixed $email Description.
  *
  * @access public
  *
  * @return mixed Value.
  */
 public function verify($email)
 {
     if (!defined('KICKBOXAPIKEY')) {
         $this->__log('API KEY NOT SETUP!');
         return false;
     }
     if (class_exists('Kickbox\\Client')) {
         $client = new Kickbox\Client(KICKBOXAPIKEY);
         $kickbox = $client->kickbox();
         try {
             $this->__log('checking email: ' . $email);
             $response = $kickbox->verify($email);
             $this->__log('response: ' . print_r($response->body, true));
             return $this->__process($response);
         } catch (Exception $e) {
             $this->__log("Code: " . $e->getCode() . " Message: " . $e->getMessage());
         }
     } else {
         $this->__log('file autoload.php is missing or cannot be loaded');
         return false;
     }
 }
Beispiel #3
0
 /**
  * @param string $email
  * @return \Kickbox\HttpClient\Response
  * @throws Exception
  */
 protected function _getResponse($email)
 {
     $kickBox = new \Kickbox\Client($this->_getCode(), [\Guzzle\Http\Client::CURL_OPTIONS => [CURLOPT_TIMEOUT => 7]]);
     return $kickBox->kickbox()->verify($email);
 }
Beispiel #4
0
 /**
  * @param string $email
  * @return \Kickbox\HttpClient\Response
  * @throws Exception
  */
 protected function _getResponse($email)
 {
     $kickBox = new \Kickbox\Client($this->_getCode());
     return $kickBox->kickbox()->verify($email);
 }