Swiftmailer error when send email

Hello; When sending email I am getting this error Swift_TransportException and the line giving the error is this on here

 if (false === $this->_stream) {

            throw new Swift_TransportException(

                'Connection could not be established with host '.$this->_params['host'].

                ' ['.$errstr.' #'.$errno.']'));


What does that mean? How can I correct that problem?


Is localhost smtp reachable?

SwiftMailer is an excellent library because it provides great error messages.

So, what is $this->_params[‘host’] ?

I usually insert a die($this->_params[‘host’]) - that should make it obvious.