I'm trying to send an email from Office365 using Laravel from IIS server. I'm getting this error: Connection could not be established with host smtp.office365.com [ #0]
I'm using tls with port 587.
I also tried 465 port but it didn't work. below is the code from where i'm getting this error
if (isset($this->params['stream_context_options'])) {
$options = array_merge($options, $this->params['stream_context_options']);
}
$streamContext = stream_context_create($options);
$this->stream = @stream_socket_client($host.':'.$this->params['port'], $errno, $errstr, $timeout, STREAM_CLIENT_CONNECT, $streamContext);
if (false === $this->stream) {
throw new Swift_TransportException(
'Connection could not be established with host '.$this->params['host'].
' ['.$errstr.' #'.$errno.']'
);
}
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire