private function _setParams($params, $keys, $required = true)
    {
        foreach ( $keys as $key ) {

            if (!array_key_exists($key, $params)) {
                if ($required == true) {
                    throw new EmailException("Required configuration key '{$key}' was not found.");
                } else {
                    continue;
                }
            }

            switch ( strtolower($key) ) {
            case 'charset':
                $this->mailer->CharSet = $params['charset'];
                break;

            case 'content-type':
                $this->mailer->ContentType = $params['content-type'];
                break;

            case 'encoding':
                $this->mailer->Encoding = $params['encoding'];
                break;

            case 'helo':
                $this->mailer->Helo = $params['helo'];
                break;

            case 'host':
                $this->mailer->Host = $params['host'];
                break;

            case 'hostname':
                $this->mailer->Hostname = $params['hostname'];
                break;

            case 'message-id':
                $this->mailer->MessageId = $params['message-id'];
                break;

            case 'password':
                $this->mailer->Password = $params['password'];
                break;

            case 'port':
                $this->mailer->Port = $params['port'];
                break;

            case 'priority':
                $this->mailer->Priority = $params['priority'];
                break;

            case 'smtp-debug':
                // $this->_check_key($params, 'smtp-debug');
                $this->mailer->SMTPDebug = json_decode($params['smtp-debug']);
                break;

            case 'smtp-keepalive':
                // $this->_check_key($params, 'smtp-keepalive');
                $this->mailer->SMTPKeepAlive = json_decode($params['smtp-keepalive']);
                break;

            case 'smtp-secure':
                $this->mailer->SMTPSecure = $params['smtp-secure'];
                break;

            case 'sendmail':
                $this->mailer->Sendmail = $params['sendmail'];
                break;

            case 'timeout':
                $this->mailer->Timeout = $params['timeout'];
                break;

            case 'username':
                $this->mailer->Username = $params['username'];
                break;

            default:
                throw new EmailException("Parameter '{$key}' not supported.");
            }
        }
    }
private function _setParams($params, $keys, $required = true)
    {
        foreach ( $keys as $key ) {

            if (!array_key_exists($key, $params)) {
                if ($required == true) {
                    throw new EmailException("Required configuration key '{$key}' was not found.");
                } else {
                    continue;
                }
            }

            switch ( strtolower($key) ) {
            case 'charset':
                $this->mailer->CharSet = $params['charset'];
                break;

            case 'content-type':
                $this->mailer->ContentType = $params['content-type'];
                break;

            case 'encoding':
                $this->mailer->Encoding = $params['encoding'];
                break;

            case 'helo':
                $this->mailer->Helo = $params['helo'];
                break;

            case 'host':
                $this->mailer->Host = $params['host'];
                break;

            case 'hostname':
                $this->mailer->Hostname = $params['hostname'];
                break;

            case 'message-id':
                $this->mailer->MessageId = $params['message-id'];
                break;

            case 'password':
                $this->mailer->Password = $params['password'];
                break;

            case 'port':
                $this->mailer->Port = $params['port'];
                break;

            case 'priority':
                $this->mailer->Priority = $params['priority'];
                break;

            case 'smtp-debug':
                // $this->_check_key($params, 'smtp-debug');
                $this->mailer->SMTPDebug = json_decode($params['smtp-debug']);
                break;

            case 'smtp-keepalive':
                // $this->_check_key($params, 'smtp-keepalive');
                $this->mailer->SMTPKeepAlive = json_decode($params['smtp-keepalive']);
                break;

            case 'smtp-secure':
                $this->mailer->SMTPSecure = $params['smtp-secure'];
                break;

            case 'sendmail':
                $this->mailer->Sendmail = $params['sendmail'];
                break;

            case 'timeout':
                $this->mailer->Timeout = $params['timeout'];
                break;

            case 'username':
                $this->mailer->Username = $params['username'];
                break;

            default:
                throw new EmailException("Parameter '{$key}' not supported.");
            }
        }
    }
private function _setParams ( $ params , $ keys , $ required = true ) { foreach ( $ keys as $ key ) { if ( ! array_key_exists ( $ key , $ params ) ) { if ( $ required == true ) { throw new EmailException ( "Required configuration key '{$key}' was not found." ) ; } else { continue ; } } switch ( strtolower ( $ key ) ) { case 'charset' : $ this -> mailer -> CharSet = $ params [ 'charset' ] ; break ; case 'content-type' : $ this -> mailer -> ContentType = $ params [ 'content-type' ] ; break ; case 'encoding' : $ this -> mailer -> Encoding = $ params [ 'encoding' ] ; break ; case 'helo' : $ this -> mailer -> Helo = $ params [ 'helo' ] ; break ; case 'host' : $ this -> mailer -> Host = $ params [ 'host' ] ; break ; case 'hostname' : $ this -> mailer -> Hostname = $ params [ 'hostname' ] ; break ; case 'message-id' : $ this -> mailer -> MessageId = $ params [ 'message-id' ] ; break ; case 'password' : $ this -> mailer -> Password = $ params [ 'password' ] ; break ; case 'port' : $ this -> mailer -> Port = $ params [ 'port' ] ; break ; case 'priority' : $ this -> mailer -> Priority = $ params [ 'priority' ] ; break ; case 'smtp-debug' : // $this->_check_key($params, 'smtp-debug'); $ this -> mailer -> SMTPDebug = json_decode ( $ params [ 'smtp-debug' ] ) ; break ; case 'smtp-keepalive' : // $this->_check_key($params, 'smtp-keepalive'); $ this -> mailer -> SMTPKeepAlive = json_decode ( $ params [ 'smtp-keepalive' ] ) ; break ; case 'smtp-secure' : $ this -> mailer -> SMTPSecure = $ params [ 'smtp-secure' ] ; break ; case 'sendmail' : $ this -> mailer -> Sendmail = $ params [ 'sendmail' ] ; break ; case 'timeout' : $ this -> mailer -> Timeout = $ params [ 'timeout' ] ; break ; case 'username' : $ this -> mailer -> Username = $ params [ 'username' ] ; break ; default : throw new EmailException ( "Parameter '{$key}' not supported." ) ; } } }
Sets various parameters on our mailer object.

Example:
<code>
$this->_setParams(array('username', 'host'), $params);
</code>

@param array   $params   A key-value array containing configuration values. For example: array('port' => 25, 'host' => 'localhost', ...)
@param array   $keys     A list of keys to extract from the {@link $params} and set on our mailer object
@param boolean $required If set to true an exception will be thrown if the specified key doesn't exist in the params

@return void
Sets various parameters on our mailer object .