Unable to send email out, but can receive emails

I followed your article on installing XYZ SMTP server. I was able to create SMTP server successfully, but while testing email is not going out, though I can receive emails.

First of all, test whether port 25 outbound traffic is open or not.

To do that you can use “telnet” as follows

telnet smtp.gmail.com 25

You will get connected message, if not your port 25 is blocked. Contact your hosting provider to open port 25.

Sometimes you will get an error message like telnet not found.
In that case, you need to install telnet

yum install telnet -y

or

apt install telnet -y

If your port 25 is open then you need to check your server IP for blacklisting. Blacklisted IP won’t be able to deliver email. You can use mxtoolbox.com to check for blacklisting.

If your IP is not blacklisted on any 3rd party website, then you might have been blacklisted by ISP itself. Check your logs. Most of the time you will get bounced emails stating the error code and reason for the failed delivery.

If all fails then you might want to contact your hosting or ISP itself to know the cause.

Regards