14.04.2023, 11:37
Try running this script. If you still get connection refused error then contact Microsoft and ask why your connection is blocked.
Code:
sock = require('socket').tcp()
sock:settimeout(5)
res, err = sock:connect('smtp.office365.com', 587)
sock:close()
log(res, err)