mail
mail copied to clipboard
Open stream with socket error
Fatal error in : \vendor\nette\mail\src\Mail\SmtpMailer.php on line 128
i'm using php_sockets, how i do ?
The connection to SMTP server was not established. What is the error message?
@milo, I can not see the details of the error, but I'll try to do something to solve it. I already enabled the extension: php_sockets.dll
The error happens in: SmtpMailer.php
$this->connection = @stream_socket_client( // @ is escalated to exception
($this->secure === 'ssl' ? 'ssl://' : '') . $this->host . ':' . $this->port,
$errno, $error, $this->timeout, STREAM_CLIENT_CONNECT, $this->context
);
if (!$this->connection) {
throw new SmtpException($error, $errno);
}
Lines: 123 - 129
On Gmail connection errno = 0 There is no error details message
/** SMTP From GMAIL */
$mailer = new SmtpMailer([
'host' => 'smtp.gmail.com',
'username' => '[email protected]',
'password' => '********',
'secure' => 'ssl'
]);
On Outlook:
/** SMTP From HOTMAIL */
$mailer = new SmtpMailer([
'host' => 'smtp-mail.outlook.com',
'port' => '587', // ou 25
'username' => '[email protected]',
'password' => '********',
'secure' => 'tls'
]);
Returns:
Warning: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in C:\inetpub\wwwroot\Usuários\LocalUser\eltonrst\public_html\Igreja\vendor\nette\mail\src\Mail\SmtpMailer.php on line 142
Fatal error: in C:\inetpub\wwwroot\Usuários\LocalUser\eltonrst\public_html\Igreja\vendor\nette\mail\src\Mail\SmtpMailer.php on line 143