Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open stream with socket error #37

Open
EltonRst opened this issue Apr 12, 2017 · 2 comments
Open

Open stream with socket error #37

EltonRst opened this issue Apr 12, 2017 · 2 comments

Comments

@EltonRst
Copy link

Fatal error in : \vendor\nette\mail\src\Mail\SmtpMailer.php on line 128
i'm using php_sockets, how i do ?

@milo
Copy link
Member

milo commented Apr 12, 2017

The connection to SMTP server was not established. What is the error message?

@EltonRst
Copy link
Author

EltonRst commented Apr 12, 2017

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants