Here is twick to test your SMTP port and telnet connection from OS. In this example OS is solaries 10.
1) check ip address of mail server by nslookup command and mail server fqdn
e.g nslookup mail.xyz.com
This will return name and IP address of mail server.
> Name:- mail.xyz.com
later step are given in below screen shot.