Announcement

Collapse
No announcement yet.

Erro 500: Could not open socket: stream_socket_client(): (Connection refused)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Erro 500: Could not open socket: stream_socket_client(): (Connection refused)

    Hello,
    When setting up the email service and trying to send a test message, the following error appears:
    Erro 500: Could not open socket: stream_socket_client(): unable to connect tcp://mail.pascoalmoretti.com.br:587 (Connection refused)

    For other applications on the same server I have no problems, only for ESPOCRM
    Do you know how to inform me if I need to configure a file or something?
    Sorry English, I'm using google translator

  • #2
    This should NOT be in bug reports section.
    If you find EspoCRM good, we would greatly appreciate it if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment


    • #3
      Hi,
      provide please a screenshot with your email SMTP configs. Also, provide the error description from a log file located in the /data/logs directory.

      Comment


      • #4
        Following information:

        [2020-03-05 16:54:56] Espo.ERROR: (500) Could not open socket: stream_socket_client(): unable to connect to tcp://mydomain.com.br:587 (Connection refused); POST /espo/api/v1/Email/action/sendTestEmail; line: 416, file: /home/username/public_html/espo/application/Espo/Core/Mail/Sender.php [] []
        [2020-03-05 16:55:08] Espo.ERROR: (500) Could not open socket: stream_socket_client(): unable to connect to tcp://mydomain.com.br:587 (Connection refused); POST /espo/api/v1/Email/action/sendTestEmail; line: 416, file: /home/username/public_html/espo/application/Espo/Core/Mail/Sender.php [] []
        [2020-03-05 17:09:13] Espo.ERROR: (500) Could not open socket: stream_socket_client(): unable to connect to tcp://mydomain.com.br:587 (Connection refused); POST /espo/api/v1/Email/action/sendTestEmail; line: 416, file: /home/username/public_html/espo/application/Espo/Core/Mail/Sender.php [] []
        [2020-03-05 17:14:28] Espo.ERROR: (500) Could not open socket: stream_socket_client(): unable to connect to tcp://mydomain.com.br:587 (Connection refused); POST /espo/api/v1/Email/action/sendTestEmail; line: 416, file: /home/username/public_html/espo/application/Espo/Core/Mail/Sender.php [] []
        [2020-03-05 17:14:38] Espo.ERROR: (500) Could not open socket: stream_socket_client(): unable to connect to tcp://mydomain.com.br:587 (Connection refused); POST /espo/api/v1/Email/action/sendTestEmail; line: 416, file: /home/username/public_html/espo/application/Espo/Core/Mail/Sender.php [] []
        [2020-03-05 17:14:50] Espo.ERROR: (500) Could not open socket: stream_socket_client(): unable to connect to tcp://mydomain.com.br:587 (Connection refused); POST /espo/api/v1/Email/action/sendTestEmail; line: 416, file: /home/pusername/public_html/espo/application/Espo/Core/Mail/Sender.php [] []
        [2020-03-05 17:15:01] Espo.ERROR: (500) Could not open socket: stream_socket_client(): unable to connect to tcp://mydomain.com.br:587 (Connection refused); POST /espo/api/v1/Email/action/sendTestEmail; line: 416, file: /home/username/public_html/espo/application/Espo/Core/Mail/Sender.php [] []
        [2020-03-05 17:15:12] Espo.ERROR: (500) Could not open socket: stream_socket_client(): unable to connect to tcp://mydomain.com.br:587 (Connection refused); POST /espo/api/v1/Email/action/sendTestEmail; line: 416, file: /home/username/public_html/espo/application/Espo/Core/Mail/Sender.php [] []
        [2020-03-05 17:19:38] Espo.ERROR: (500) Could not open socket: stream_socket_client(): unable to connect to tcp://mydomain.com.br:587 (Connection refused); POST /espo/api/v1/Email/action/sendTestEmail; line: 416, file: /home/username/public_html/espo/application/Espo/Core/Mail/Sender.php [] []
        [2020-03-05 17:24:24] Espo.ERROR: (500) Could not open socket: stream_socket_client(): unable to connect to tcp://mydomain.com.br:587 (Connection refused); POST /espo/api/v1/Email/action/sendTestEmail; line: 416, file: /home/username/public_html/espo/application/Espo/Core/Mail/Sender.php [] []
        [2020-03-05 17:31:07] Espo.ERROR: (500) Could not open socket: stream_socket_client(): unable to connect to tcp://mydomain.com.br:587 (Connection refused); POST /espo/api/v1/Email/action/sendTestEmail; line: 416, file: /home/username/public_html/espo/application/Espo/Core/Mail/Sender.php [] []

        Comment


        • #5
          I see it is port 587 (Porta). Maybe try Port 465 as your email might be SSL, or temporary do a test with Port 25

          Comment


          • #6
            Do I need to configure any internal files on the server?

            Comment


            • #7
              No, I think he is talking about changing your SMTP configs in EspoCRM. Change Security to 'SSL' and Port to '465' and try to compose an email or send the test email.

              Comment


              • esforim
                esforim commented
                Editing a comment
                Yes, have a look at Seguranca and Porta in your screenshot. Try change that, then send an email see if you can send email.

            • #8
              the same message occurs for both port 465 and port 25. I suspect it is something of the application. Other tools I use at the provider, I use the same settings and this error does not occur.

              Comment


              • #9
                I did a quick search and this error is related to PHP. Have a look at your PHP extension, try see if there a Zend option? Or try changing your PHP Version.

                Or could ask your Host support to see know how to fix "Could not open socket: stream_socket_client()" error.

                Have you tried any other email yet? Try using more common public email for testing first (e.g. Hotmail, Live, Outlook, Gmail, Yahoo, etc)

                Comment


                • #10
                  Hi,
                  I've tried everything, changed ports, changed emails, private and public, but I hadn't tried this PHP option. I'll check

                  Comment


                  • #11
                    Hello, I managed to solve the problem by replacing the SMTP address (mail.mydomain.com.br) with LOCALHOST. That is, instead of putting the full address, I just put localhost and it worked.

                    Comment


                    • esforim
                      esforim commented
                      Editing a comment
                      That a smart work-around.

                  • #12
                    I had the same problem and the solution was to open the outbound port (993) in the server that hosts EspoCRM

                    Comment

                    Working...
                    X