If you have a SMTP email server and you want to test if it is working properly, you can following the steps below to test it.
user_name@myhost:~$ telnet 127.0.0.1 25
Connected to 127.0.0.1.
Escape character is '^]'.
220 myhost ESMTP Sendmail 8.14.3/8.14.3/Debian-9ubuntu1; Sat, 16 Jan 2010 17:28:30 -0800; (No UCE/UBE) logging access from: localhost(OK)-localhost [127.0.0.1]
250 myhost Hello localhost [127.0.0.1], pleased to meet you
354 Enter mail, end with "." on a line by itself
250 2.0.0 o0H1SUjV016265 Message accepted for delivery
221 2.0.0 npu40 closing connection
Connection closed by foreign host.
If you can receive the above email properly, it means you can send email from the localhost. Next step, you can try to telnet it external IP address, like 192.168.0.123, to check if it can relay emails through the external IP address.