So with iptables / ufw you tend to block incoming traffic, but the error is about outgoing traffic from your server to mailersend.net.
But that is not your issue.
Port 25 is not being used for relaying emails (as opposed to delivering them) nowadays. Instead, most email services use port 587, and when I google for the mailersend documentation it indeed tells you to use port 587, not port 25.