Network comes before application. You've not mentioned other details about your setup so suggestions below may not apply to your platform (adjust).
The error says it was 'temporary' but it also gives a hint/clue ... name resolution failed. That's network - specifically DNS.
Can't compare version 2.5 on another IP addresses server with the 2.7 on a IP address of it's own as this isn't really a moodle error but a network/network configuration error.
Do these suggested networking test from both servers. Do some DNS digs for the stmp server by it's fully qualified domain name (that's not Windows domain .... that's internet domain - ie, stmp.somenetwork.net):
Does that respond with an IP address for the smtp server? If it does, do a reverse lookup:
dig -x [theipaddressseenabove]
If the first dig didn't work, check your servers DNS settings /etc/resolv.conf.
and try dig pointing at specific DNS servers seen in the resolv.conf file. Example;
dig @[IPAddressofDNSserver] stmp.somenetwork.net
If the digs fail it might have something to do with routing and/or the switch ports the 2.7 servers is plugged into (depending upon what DNS servers are queried)
IF in resolv.conf only one DNS server @192.168.1.30 but one cannot ping nor traceroute to 192.168.1.30 then it's a network issue and no amount of config in Moodle will work ... remember ... network comes before application.
If on restarts the 2.7 server and it's resolved that fix might be only temporary. Expect the issue to rear it's ugly head again in the future until there is an investigation of networking/DNS config.
'spirit of sharing', Ken