Hello Rahul,
The error connection refused indicates that the app cannot reach mail server smtp.office365.com on port 587.
If you are running the app in your machine, please validate if you could reach the server. May be tools like ping or telnet can help.
If it is used on the mendix paid cloud, you should check outgoing connections for the app.