This a networking issue, related to firewall settings or IP
From the message server 10.40.xx.xxx, the SAP Gateway on
computer 10.40.yy.yyy cannot be reached via port 3300.
on the message server ok? Is port 3300 open in the firewall
Since "ping" cannot check an indiviual port, you can use "psping"
I hope that you can narrow down the problem with these tools. Also, it helps
if you can find out which network parameter has recently been changed. In Google
there are a couple of additional hints; search for "connect to sap gateway