Hello,
on my local site I can send mail without problem for user login confermation, using user amnah module ( https://github.com/amnah/yii2-user ).
On the real site I can’t. Same configuration. Any idea?
Swift_TransportException
Connection could not be established with host smtp.gmail.com [Connection refused #111]
1. in /home/maldistrjr/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php at line 265
256257258259260261262263264265266267268269270271272273274
if (!empty($this->_params['timeout'])) {
$timeout = $this->_params['timeout'];
}
$options = array();
if (!empty($this->_params['sourceIp'])) {
$options['socket']['bindto'] = $this->_params['sourceIp'].':0';
}
$this->_stream = @stream_socket_client($host.':'.$this->_params['port'], $errno, $errstr, $timeout, STREAM_CLIENT_CONNECT, stream_context_create($options));
if (false === $this->_stream) {
throw new Swift_TransportException(
'Connection could not be established with host '.$this->_params['host'].
' ['.$errstr.' #'.$errno.']'
);
}
if (!empty($this->_params['blocking'])) {
stream_set_blocking($this->_stream, 1);
} else {
stream_set_blocking($this->_stream, 0);
}
2. in /home/maldistrjr/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php – Swift_Transport_StreamBuffer::_establishSocketConnection() at line 62
56575859606162636465666768
switch ($params['type']) {
case self::TYPE_PROCESS:
$this->_establishProcessConnection();
break;
case self::TYPE_SOCKET:
default:
$this->_establishSocketConnection();
break;
}
}
/**
* Set an individual param on the buffer (e.g. switching to SSL).
3. in /home/maldistrjr/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php – Swift_Transport_StreamBuffer::initialize(['protocol' => 'tcp', 'host' => 'smtp.gmail.com', 'port' => 587, 'timeout' => 30, ...])