We recently migrated our email to Microsoft office 365 which would only allow connection with STARTTLS, since this our email configuration is refusing to connect.
Failed to connect to smtp.office365.com:587 [SMTP: Failed to connect socket: Connection refused (code: -1, response: )]

Please help us to help you by reading and following the posting guidelines located in this thread: Please read before requesting assistance. The more information you give us the better we will be able to assist you. Thank you.

Environment details? (see Admin panel -> Dashboard -> Information)

Connection refused is generally the remote end or a firewall between the server and teh remote end.

Server Information:
osTicket Version v1.16.3 (e148727) — Up to date
Web Server Software Apache
MySQL Version 5.6.51
PHP Version 8.0.18

The option for STARTLS isn't available for email, this is why the email server is refusing the connection. 🙁

    danibaez

    Can you add tls:// to the beginning of the hostname? So instead of smtp.office365.com put tls://smtp.office365.com and retest. If all else fails you need to make sure your openssl is up-to-date on your server and retest.

    Cheers.

      4 days later

      Thanks, it's not tls its supposed to work with starttls. I will see if this works.

        6 months later

        KevinTheJedi
        please see the below error when adding tls://. please help me.

        Failed to connect to tls://smtp.office365.com:587 [SMTP: Failed to connect socket: stream_socket_client(): unable to connect to tls://smtp.office365.com:587 (Unknown error) (code: -1, response: )]

          bards

          You need to check your server to see if you have a firewall, blocked port, etc. You can attempt to telnet to the host and port from your server's cli to see if you can actually connect.

          Cheers.

          11 days later

          @bards you should really start your own thread. This one is 6 months old.
          Please help us to help you by reading and following the posting guidelines located in this thread: Please read before requesting assistance. The more information you give us the better we will be able to assist you. Thank you.

          Environment details? (see Admin panel -> Dashboard -> Information)

          Write a Reply...