/**
  * Constructor.
  *
  * @param  string  $host
  * @param  integer $port
  * @param  array   $config
  * @return void
  * @throws Zend_Mail_Protocol_Exception
  */
 public function __construct($host = '127.0.0.1', $port = null, array $config = array())
 {
     if (isset($config['ssl'])) {
         switch (strtolower($config['ssl'])) {
             case 'tls':
                 $this->_secure = 'tls';
                 break;
             case 'ssl':
                 $this->_transport = 'ssl';
                 $this->_secure = 'ssl';
                 if ($port == null) {
                     $port = 465;
                 }
                 break;
             default:
                 /**
                  * @see Zend_Mail_Protocol_Exception
                  */
                 require_once 'Zend/Mail/Protocol/Exception.php';
                 throw new Zend_Mail_Protocol_Exception($config['ssl'] . ' is unsupported SSL type');
                 break;
         }
     }
     // If no port has been specified then check the master PHP ini file. Defaults to 25 if the ini setting is null.
     if ($port == null) {
         if (($port = ini_get('smtp_port')) == '') {
             $port = 25;
         }
     }
     parent::__construct($host, $port);
 }