I just experienced this upon moving to a new host. Open a support ticket with the host and ask if there is a block on ports for email (25, 465, 587). Mine had one and removed it. Then you have to consider your Control Panel software. DirectAdmin, for example, has a default position of blocking those ports on installation. Documentation is hard to find about it.
The magic term is "SMTP_BLOCK" -- it turns out that DirectAdmin has a page with many firewall commands, there is one for Remove SMTP_BLOCK and it takes one second to click it, and it's fixed.
Finally, if still not working, if you use outside email, check with that provider, their software might have blocked your IP based on what people have done with it in the past.
It's highly unlikely to be a Flarum issue.