Testing whether your server can connect outbound on a port can be very important for troubleshooting a wide range of issues. Including whether SMTP is functional or whether or not your host can connect to MySQL remotely.
You can use telnet to attempt to connect to a port on a remote host. You will see "Connected to host" if it is successful.
[root@184-94-197-2 ~]# telnet portquiz.net 25
Connected to portquiz.net.
Escape character is '^]'.o
You can also use nmap to test connectivity for multiple ports at once.
[root@184-94-197-2 ~]# nmap portquiz.net -p 25,26,465,567,80,443
Starting Nmap 6.40 ( http://nmap.org ) at 2021-04-13 12:32 CDT
Nmap scan report for portquiz.net (22.214.171.124)
Host is up (0.11s latency).
rDNS record for 126.96.36.199: ec2-52-47-209-216.eu-west-3.compute.amazonaws.com
PORT STATE SERVICE
25/tcp open smtp
26/tcp open rsftp
80/tcp open http
443/tcp open https
465/tcp closed smtps
567/tcp open unknown
portquiz.net is a domain that exists for port testing and will have all basic ports open for inbound connections.
For information on telnet and nmap, please see the following.