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

Connection could not be established with host "ssl://smtp-relay.sendinblue.com:587"... #40973

Closed
brunoalfred opened this issue Feb 12, 2022 · 6 comments

Comments

@brunoalfred
Copy link

  • Laravel Version: 9.0.1
  • PHP Version: 8.1.2
  • Database Driver & Version:

Description:

Im using Sendinblue for mailing, the error appears as:

Connection could not be established with host "ssl://smtp-relay.sendinblue.com:587": stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages: error:1408F10B:SSL routines:ssl3_get_record:wrong version 

Steps To Reproduce:

I added the following to my .env (both local and production):

MAIL_MAILER=smtp
MAIL_HOST=smtp-relay.sendinblue.com
MAIL_PORT=587
MAIL_USERNAME=<login_value>
MAIL_PASSWORD=<master_password>
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=<[email protected]>
MAIL_FROM_NAME="${APP_NAME}"

And enabled email verification feature when registering user on jetstream.

  • The Exception returned :
Symfony \ Component \ Mailer \ Exception \ TransportException
  • With Message
Connection could not be established with host "ssl://smtp-relay.sendinblue.com:587": stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages: error:1408F10B:SSL routines:ssl3_get_record:wrong version number

@it-can
Copy link
Contributor

it-can commented Feb 12, 2022

Maybe try withMAIL_ENCRYPTION=null

@Hesammousavi
Copy link
Contributor

Hesammousavi commented Feb 12, 2022

i have this problem too
i set MAIL_ENCRYPTION=null but still have this error

production.ERROR: Unable to connect with STARTTLS: stream_socket_enable_crypto(): SSL: Success {"exception":"[object] (Symfony\\Component\\Mailer\\Exception\\TransportException(code: 0): Unable to connect with STARTTLS: stream_socket_enable_crypto(): SSL: Success at /home/forge/auth.roocket.ir/vendor/symfony/mailer/Transport/Smtp/Stream/SocketStream.php:171

@it-can
Copy link
Contributor

it-can commented Feb 12, 2022

And if you try laravel 9.0.2?

@it-can
Copy link
Contributor

it-can commented Feb 12, 2022

There is a fix here #40887

@Hesammousavi
Copy link
Contributor

@it-can
i checked it and i still get this error

[2022-02-12 23:25:42] production.ERROR: Unable to connect with STARTTLS: stream_socket_enable_crypto(): SSL: Success {"exception":"[object] (Symfony\\Component\\Mailer\\Exception\\TransportException(code: 0): Unable to connect with STARTTLS: stream_socket_enable_crypto(): SSL: Success at /home/forge/auth.roocket.ir/vendor/symfony/mailer/Transport/Smtp/Stream/SocketStream.php:171)

@brunoalfred
Copy link
Author

On my side i tried to change the port to 465 on section MAIL_PORT and the error is gone and emails are sent and delivered...

  • I hope this #40887 is one of ways to fix... Thanks @it-can
    i think its okay if i close the issue since the solution is attained.

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

3 participants